Calendar
Picks a date, or a range of dates, from a month grid. Moves between months with its buttons or the keyboard.
October 2026
| SUN | MON | TUE | WED | THU | FRI | SAT |
|---|---|---|---|---|---|---|
Usage
Import the component and render it.
import { Calendar } from 'src/components/Calendar/Calendar';
<Calendar selection="single" month="2026-10" today="2026-10-01" />Accessibility
Role: group named by the month and year, with a table of date buttons.
| Key | Action |
|---|---|
| Tab | Moves between Previous month, Next month and the focused date |
| Arrow keys | Move the focus by one day (left/right) or one week (up/down), crossing months |
| Home / End | First / last day of the week |
| Page Up / Page Down | Previous / next month (with Shift: year) |
| Enter / Space | Selects the focused date |
- Only one date is in the Tab order: the selected date, else today, else the first of the month.
- Each date is named by its full date; today has aria-current="date" and the selected dates aria-pressed="true".
- The month and year are a live region, so moving to another month is announced.
Selection
Set the selection prop: Single is "single", Range is "range".
October 2026
| SUN | MON | TUE | WED | THU | FRI | SAT |
|---|---|---|---|---|---|---|
October 2026
| SUN | MON | TUE | WED | THU | FRI | SAT |
|---|---|---|---|---|---|---|
<Calendar selection="single" />
<Calendar selection="range" />Composition
Use the following composition to build a Calendar:
Calendar
├── CalendarDate
└── ButtonCalendarDate
One date of the Calendar grid: a 40px round button. Only used inside Calendar.
<CalendarDate label="14" />Used in
Calendar is part of DatePicker.
Actions
Pass callbacks to respond to the component.
import { Calendar } from 'src/components/Calendar/Calendar';
<Calendar
selection="single"
month="2026-10"
today="2026-10-01"
onValueChange={(value) => console.log(value)}
onRangeStartChange={(value) => console.log(value)}
onRangeEndChange={(value) => console.log(value)}
onMonthChange={(month) => console.log(month)}
/>| Callback | When |
|---|---|
onValueChange | Called with the date the user selects (Single). |
onRangeStartChange | Called when the range start changes. |
onRangeEndChange | Called when the range end changes. |
onMonthChange | Called when the user moves to another month. |
