Forms
CalendarRange
Range picker: first click sets the start, second the end, with a hover preview of the pending range. Two months on wide screens.
import { CalendarRange } from "datui";Playground
November 2026
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
December 2026
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
<CalendarRange weekStartsOn={1} numberOfMonths={2} />Examples
Basic
Accessibility
- Each month is a
role="grid"witharia-multiselectable; days in the range havearia-selected. - Keyboard navigation is the same as Calendar; Enter/Space set the start, then the end (an earlier end becomes the start).
- The chosen range is announced through a polite status region.
API
CalendarRange
Range picker: the first click sets the start, the second the end (an earlier day becomes the start). While only the start is chosen, hovering previews the pending range. Two months on wide screens, one on compact.
| Prop | Type | Default | Description |
|---|---|---|---|
| autoFocus | boolean | false | Move focus into the grid on mount. |
| changeMonthLabel | string | "Month" | |
| changeYearLabel | string | "Year" | |
| className | string | — | |
| defaultValue | CalendarRangeValue | null | |
| defaultViewDate | Date | the start's month, else the current month | |
| disableFuture | boolean | — | |
| disablePast | boolean | — | |
| disablePickers | boolean | false | Plain month titles instead of pickers (pickers only show with a single month). |
| nextMonthIcon | ReactNode | — | |
| nextMonthLabel | string | "Next month" | |
| numberOfMonths | number | 2 on regular width, 1 on compact width | Months shown side by side. |
| onChange | ((value: CalendarRangeValue) => void) | — | Called after each click: `[start, null]` after the first, `[start, end]` after the second. |
| onViewDateChange | ((viewDate: Date) => void) | — | |
| prevMonthIcon | ReactNode | — | |
| prevMonthLabel | string | "Previous month" | |
| renderDayContent | ((date: Date) => ReactNode) | — | |
| shouldDisableDate | ((date: Date) => boolean) | — | |
| value | CalendarRangeValue | — | |
| viewDate | Date | — | |
| weekStartsOn | 0 | 1 | 4 | 2 | 3 | 5 | 6 | 1 |