Forms
ICalendar
A month grid that stays on the page. The same grid IDatePicker puts behind a field, for the times a popover is the wrong shape: a booking page, an availability view, a date shown beside the thing it applies to.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
The model is an ISO YYYY-MM-DD string, never a Date — see the date helpers for why. Clicking the selected day again clears it, unless preventDeselect is set.
Picker or calendar
Reach for IDatePicker inside a form: a field the reader scans past until they need it, in a column of other fields. Reach for ICalendar when choosing the date is the task on the page, or when what is available has to be visible without opening anything.
Several months
months shows more than one at a time, which is what makes a span legible without paging back and forth. pagedNavigation then advances a whole view at a time rather than a single month.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
For picking a start and an end rather than one day, use IDateRangePicker.
Bounds and availability
min and max fence the selectable range. isUnavailable refuses individual days — a taken slot, a closed day — and is given an ISO string, not a DateValue.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
The two states are drawn differently on purpose. A day outside min/max is faded — it is not part of this calendar's business. An unavailable day is struck through, because it is a real day that someone has already taken: hiding it would leave the reader wondering whether they had misread the month.
Weeks
weekStartsOn overrides the locale's own convention — 0 is Sunday. weekdayFormat sets how the headings read.
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
31 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
Every month is six rows tall by default. fixedWeeks turns that off, at the cost of the calendar changing height as the reader pages through it — which moves everything below it on the page.
Accessibility
label names the calendar for a screen reader; without one it is an unnamed grid. Arrow keys move by day, PageUp and PageDown by month, and Home / End reach the ends of the week — all of that is Reka's, not ours. initialFocus moves focus to the selected day on mount, which is right inside a popover and usually wrong on a page that has other content above it.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | null | null | The selected date, ISO YYYY-MM-DD |
min | string | — | Earliest selectable date |
max | string | — | Latest selectable date |
locale | string | — | Month names and weekday initials |
weekStartsOn | 0–6 | locale's own | 0 is Sunday |
weekdayFormat | 'narrow' | 'short' | 'long' | 'narrow' | How the headings read |
months | number | 1 | Months shown side by side |
pagedNavigation | boolean | false | Advance a whole view rather than one month |
fixedWeeks | boolean | true | Keep every month six rows tall |
disableDaysOutsideCurrentView | boolean | false | Grey out the neighbouring months' days |
disabled | boolean | false | Nothing is selectable |
readonly | boolean | false | Shows a selection but will not change it |
initialFocus | boolean | false | Focus the selected day on mount |
isUnavailable | (date: string) => boolean | — | Refuse individual days |
preventDeselect | boolean | false | Clicking the selected day again keeps it |
label | string | — | Accessible name for the calendar |
previousLabel | string | 'Previous month' | Label for the back control |
nextLabel | string | 'Next month' | Label for the forward control |
unstyled | boolean | — | Drop built-in classes |
class | string | — | Classes for the root |
ui | { root?, header?, heading?, nav?, months?, grid?, headCell?, cell?, cellTrigger? } | — | Per-element class overrides |