Recurrence editor
Every n days, weeks, months or years, on some weekdays, until a date or after n times; the sentence and the next dates.
import { RecurrenceEditor, expandRecurrence, describeRecurrence, recurrenceToRrule, parseRrule } from "@forgeron/ui";Every
Unit
Every 2 weeks on Monday and Wednesday, 6 times
- Wednesday 18 November 2026
- Monday 30 November 2026
- Wednesday 2 December 2026
import { RecurrenceEditor } from "@forgeron/ui";
export default function Weekly() {
return (
<RecurrenceEditor
start="2026-11-18"
defaultValue={{
frequency: "weekly",
interval: 2,
weekdays: [0, 2],
end: { kind: "count", count: 6 },
}}
/>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
value / defaultValue | Recurrence | null | — | { frequency, interval, weekdays?, end: never | until | count }; null does not repeat. Controlled or not. |
onChange | (rule: Recurrence | null) => void | — | On every edit. |
start | string | — | The first date, YYYY-MM-DD: the weekday and the day of the month come from it. |
preview | number | 3 | How many next dates to list. |
optional | boolean | true | The Repeat switch. |
frequencies | RecurrenceFrequency[] | all four | The units offered. |
disabled | boolean | — | Read only. |
className | string | — | Extra classes. |