Recurrence Editor
Edits how something repeats: every N days, weeks, months or years, weekdays, the third Tuesday, an end; reads and writes RRULE or cron.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
value | string | — | The rule, in format: an RRULE (FREQ=WEEKLY;BYDAY=MO,WE, an RRULE: prefix is read too) or a cron expression. Empty for "Does not repeat". |
format | RecurrenceFormat | rrule | What value holds: rrule (the default) or cron. |
name | string | — | Form field name. The form receives value. |
start | string | — | The first occurrence, YYYY-MM-DD or YYYY-MM-DDTHH:MM (DTSTART). Today when empty. |
frequencies | string | — | The frequencies offered, separated by spaces: none (Does not repeat), minutely, hourly, daily, weekly,
monthly, yearly. Defaults to daily weekly monthly yearly, and to every frequency but none in cron format. |
week-start | Weekday | MO | The first day of the week in the weekday row, MO (the default) to SU, and the WKST a new weekly rule takes
("every 2 weeks" counts weeks from that day). A rule read from value keeps its own WKST. |
with-time | boolean | false | Shows a time-of-day row, written as BYHOUR/BYMINUTE. Always shown in cron format. |
preview-count | number | 5 | How many of the next occurrences to show. 0 hides them. |
required | boolean | false | Asks for a rule other than "Does not repeat" before the form can be submitted. |
disabled | boolean | false | Prevents interaction and excludes the value from form submission. |
aria-label | string | null | null | Accessible name of the editor's group. Defaults to the enclosing field's label, then to "Recurrence". |
Slots
| Name | Description |
|---|---|
footer | An action zone below the summary: the app's own buttons (Save, Cancel). Hidden while empty. |
Events
| Name | Type | Description |
|---|---|---|
input | Event | Fired after the user changes the rule, once value holds it; also while typing a number. |
change | Event | Fired after the user changes the rule, once value holds it. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
editor | The group around every row, the summary and the footer. |
rows | The column of labelled rows. |
row | One row: its label and its controls, which wrap below the label when the row is narrow. |
label | The label at the start of each row. |
weekdays | The row of weekday toggles. |
weekday | One weekday toggle. |
summary | The sentence that sums the rule up. |
occurrences | The next occurrences. |
occurrence | One of the next occurrences. |
footer | The box around the footer slot. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-recurrence-editor--color | color | #18181b | The text colour. |
--c2-recurrence-editor--font-size | font-size | 14px | The text size. |
--c2-recurrence-editor--font-family | font-family | inherit | The text font. |
--c2-recurrence-editor--line-height | pixel | 20px | The text line height. |
--c2-recurrence-editor--gap | pixel | 16px | Space between the rows, the summary, the occurrences and the footer. |
--c2-recurrence-editor__rows--row-gap | pixel | 12px | Space between two rows. |
--c2-recurrence-editor__rows--column-gap | pixel | 16px | Space between a row's label and its controls. |
--c2-recurrence-editor__label--color | color | #71717a | The colour of the row labels and units. |
--c2-recurrence-editor__label--font-weight | font-weight | 500 | The weight of the row labels. |
--c2-recurrence-editor__label--min-width | pixel | 56px | The narrowest a row label gets, which lines the controls up. |
--c2-recurrence-editor__controls--gap | pixel | 8px | Space between the controls of a row. |
--c2-recurrence-editor__select--min-width | pixel | 160px | The narrowest a select gets, unless the row is narrower. |
--c2-recurrence-editor__number--width | pixel | 96px | The width of a number field. |
--c2-recurrence-editor__weekdays--gap | pixel | 6px | Space between two weekday toggles. |
--c2-recurrence-editor__weekday--size | pixel | 32px | The width and height of a weekday toggle. |
--c2-recurrence-editor__weekday--border | border | 1px solid #bcbcc6 | A weekday toggle's border. |
--c2-recurrence-editor__weekday--border-radius | border-radius | 999px | A weekday toggle's corner radius. |
--c2-recurrence-editor__weekday--color | color | #18181b | A weekday toggle's text colour. |
--c2-recurrence-editor__weekday--background | color | #ffffff | A weekday toggle's background. |
--c2-recurrence-editor__weekday--font-size | font-size | 12px | A weekday toggle's text size. |
--c2-recurrence-editor__weekday--font-weight | font-weight | 500 | A weekday toggle's text weight. |
--c2-recurrence-editor__weekday__hover--border | border | 1px solid #a1a1aa | A weekday toggle's border on hover. |
--c2-recurrence-editor__weekday__selected--color | color | #ffffff | A selected weekday's text colour. |
--c2-recurrence-editor__weekday__selected--background | color | #0265dc | A selected weekday's background. |
--c2-recurrence-editor__weekday__selected--border | border | 1px solid #0265dc | A selected weekday's border. |
--c2-recurrence-editor__weekday__focus--outline | outline | 2px solid rgba(2, 101, 220, 0.4) | A weekday toggle's focus ring. |
--c2-recurrence-editor__summary--color | color | #18181b | The summary's text colour. |
--c2-recurrence-editor__summary--font-weight | font-weight | 500 | The summary's text weight. |
--c2-recurrence-editor__summary--padding | padding | 10px 12px | Space inside the summary. |
--c2-recurrence-editor__summary--background | color | #f4f4f5 | The summary's background. |
--c2-recurrence-editor__summary--border-radius | border-radius | 6px | The summary's corner radius. |
--c2-recurrence-editor__occurrences--gap | pixel | 4px | Space between the next occurrences. |
--c2-recurrence-editor__occurrences--color | color | #71717a | The colour of the "Next" label. |
--c2-recurrence-editor__occurrences--font-size | font-size | 12px | The text size of the next occurrences. |
--c2-recurrence-editor__occurrence--padding | padding | 2px 8px | Space inside an occurrence. |
--c2-recurrence-editor__occurrence--border | border | 1px solid #e4e4e7 | An occurrence's border. |
--c2-recurrence-editor__occurrence--border-radius | border-radius | 999px | An occurrence's corner radius. |
--c2-recurrence-editor__occurrence--background | color | #ffffff | An occurrence's background. |
--c2-recurrence-editor__occurrence--color | color | #18181b | An occurrence's text colour. |
--c2-recurrence-editor__disabled--opacity | opacity | 0.38 | The opacity while disabled. |
Text and languages
The text the component shows, in English. It shows another language when the app adds one with addTranslations, under recurrence-editor, and the nearest lang asks for it; any message not translated stays in English. {0}, {1}… stand for the values a message carries. Languages guide.
| Key | English | Values |
|---|---|---|
group | Recurrence | — |
repeatLabel | Repeat | — |
everyLabel | Every | — |
onLabel | On | — |
inLabel | In | — |
atLabel | At | — |
endsLabel | Ends | — |
nextLabel | Next | — |
frequencyNone | Does not repeat | — |
frequencyMinutely | By the minute | — |
frequencyHourly | Hourly | — |
frequencyDaily | Daily | — |
frequencyWeekly | Weekly | — |
frequencyMonthly | Monthly | — |
frequencyYearly | Yearly | — |
unitMinutely | minutes | {0} n |
unitHourly | hours | {0} n |
unitDaily | days | {0} n |
unitWeekly | weeks | {0} n |
unitMonthly | months | {0} n |
unitYearly | years | {0} n |
modeDay | Day of the month | — |
modeWeekday | Weekday of the month | — |
modeLastDay | Last day of the month | — |
ordinal | {0} | {0} n |
intervalName | Interval | — |
weekdaysName | Days of the week | — |
modeName | Repeat on | — |
dayName | Day of the month | — |
ordinalName | Which week | — |
weekdayName | Weekday | — |
monthName | Month | — |
timeName | Time of day | — |
minuteName | Minute past the hour | — |
endName | End | — |
untilName | End date | — |
countName | Number of occurrences | — |
minuteUnit | past the hour | — |
valueMissing | Choose how often it repeats | — |
endNever | Never | — |
endUntil | On date | — |
endCount | After | — |
countUnit | occurrences | {0} n |
summaryNone | Does not repeat | — |
summaryMinutely | Every {0} minutes | {0} n |
summaryHourly | Every {0} hours | {0} n |
summaryDaily | Every {0} days | {0} n |
summaryWeekly | Every {0} weeks | {0} n |
summaryMonthly | Every {0} months | {0} n |
summaryYearly | Every {0} years | {0} n |
summaryWeekdays | Every weekday | — |
summaryOnDays | on {0} | {0} days |
summaryOnDay | on day {0} | {0} day |
summaryOnLastDay | on the last day | — |
summaryOnNth | on the {0} {1} | {0} ordinal {1} weekday |
summaryOnDate | on {0} | {0} date |
summaryOnLastDayOf | on the last day of {0} | {0} month |
summaryOnNthOf | on the {0} {1} of {2} | {0} ordinal {1} weekday {2} month |
summaryAt | at {0} | {0} time |
summaryAtMinute | at {0} minutes past the hour | {0} minute |
summaryCount | {0} times | {0} n |
summaryUntil | until {0} | {0} date |
summaryWithEnd | {0}, {1} | {0} rule {1} end |
noOccurrences | No more occurrences | — |
occurrencesName | Next occurrences | — |