Skip to content
Calm motion: animations on this site only fade, with no movement

Recurrence picker ​

A rule that repeats, with the rule in one sentence

Sets how often an event repeats, on which days, and when it stops. A sentence under the fields says the rule in plain words. For a rule as a cron line, use the cron input.

Basic

Every 2 weeks, on Monday and Thursday, 10 times

For your calendar: FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,TH;COUNT=10

  • v-model is the rule. freq is daily, weekly, monthly, or yearly, and interval is the step. days holds the days of a weekly rule, and 0 is Monday.
  • The end is { type: "never" }, { type: "count", count }, or { type: "until", until } with a date as YYYY-MM-DD.
  • A weekly rule shows a button for each day. A rule keeps at least one day.
  • toRRule(rule) gives the rule as an RRULE of the iCalendar standard, such as FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,TH;COUNT=10. Calendar apps and many servers read this form.
  • locale sets the language of the day names, the list, and the date (default English).
  • The fields are native fields, with a group of radio buttons for the end. The sentence is a status line, so screen readers hear the new rule. Change the words with labels or a label pack. The words are every, on, ends, never, after, times, and onDate. The functions are unit, everyUnit, endCount, endUntil, and summary.

Usage ​

ts
import { BlessRecurrencePicker, toRRule } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
localestring"en"the language of the day names and the date, for example `id`
labelsPartial<{ every: string; unit: (freq: BlessRepeatFreq, n: number) => string; on: string; ends: string; never: string; after: string; times: string; onDate: string; summary: (parts: { every: string; days: string; end: string; }) => string; everyUnit: (n: number, unit: string) => string; endCount: (n: number) => string; endUntil: (date: string) => string; }>—
modelValueBlessRecurrence{ freq: "weekly", interval: 1, days: [0], end: { type: "never" } }

Events

NamePayloadDescription
update:modelValue[value: BlessRecurrence]

Released under the MIT License. Character names and artwork belong to their owners.