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
For your calendar: FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,TH;COUNT=10
v-modelis the rule.freqisdaily,weekly,monthly, oryearly, andintervalis the step.daysholds 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 asYYYY-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 asFREQ=WEEKLY;INTERVAL=2;BYDAY=MO,TH;COUNT=10. Calendar apps and many servers read this form.localesets 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
labelsor a label pack. The words areevery,on,ends,never,after,times, andonDate. The functions areunit,everyUnit,endCount,endUntil, andsummary.
Usage
ts
import { BlessRecurrencePicker, toRRule } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
locale | string | "en" | the language of the day names and the date, for example `id` |
labels | Partial<{ 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; }> | — | |
modelValue | BlessRecurrence | { freq: "weekly", interval: 1, days: [0], end: { type: "never" } } |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: BlessRecurrence] |