datui
Color scheme

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
December 2026
<CalendarRange weekStartsOn={1} numberOfMonths={2} />

Examples

Basic

Accessibility

  • Each month is a role="grid" with aria-multiselectable; days in the range have aria-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.

PropTypeDefaultDescription
autoFocusbooleanfalseMove focus into the grid on mount.
changeMonthLabelstring"Month"
changeYearLabelstring"Year"
classNamestring—
defaultValueCalendarRangeValuenull
defaultViewDateDatethe start's month, else the current month
disableFutureboolean—
disablePastboolean—
disablePickersbooleanfalsePlain month titles instead of pickers (pickers only show with a single month).
nextMonthIconReactNode—
nextMonthLabelstring"Next month"
numberOfMonthsnumber2 on regular width, 1 on compact widthMonths 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)—
prevMonthIconReactNode—
prevMonthLabelstring"Previous month"
renderDayContent((date: Date) => ReactNode)—
shouldDisableDate((date: Date) => boolean)—
valueCalendarRangeValue—
viewDateDate—
weekStartsOn0 | 1 | 4 | 2 | 3 | 5 | 61