DateRangePicker

A popover-based date range picker with keyboard navigation and hover preview.

A date range picker that opens a calendar popover. Click to set the start date, click again to set the end date. Hover highlights the in-progress range.

Usage

Constrained Range

Pass minDate and maxDate to limit selection to a window. Dates outside the range are disabled.

API Reference

PropTypeDefaultDescription
value{ from: Date | null; to: Date | null }—Controlled range
defaultValueDateRange{ from: null, to: null }Uncontrolled initial value
onValueChange(range: DateRange) => void—Called when either endpoint changes
placeholderstring"Pick a date range"Trigger placeholder
disabledbooleanfalseDisables the trigger
minDateDate—Earliest selectable date
maxDateDate—Latest selectable date
isDateDisabled(date: Date) => boolean—Return true to disable a specific date
weekStartsOn0 | 10First day of the week (0 = Sunday, 1 = Monday)
formatValue(date: Date) => string—Custom trigger label formatter
size'sm' | 'md' | 'lg''md'Trigger size, the same height as an Input of that size
aria-labelstring—Accessible label for the trigger. The name keeps the selected range
aria-labelledbystring—IDs of the label elements. The name keeps the selected range
labels{ previousMonth?, nextMonth?, popup?, grid? }—Screen-reader text, for translation. popup names the popup when there is no aria-label, and grid names the day grid
icons{ trigger?, previous?, next? }—Replaces the built-in icons. See the Icons guide
sxStyleXStyles—StyleX override for the trigger

All other button attributes, such as id and aria-describedby, go to the trigger.

Keyboard

KeyAction
↑ / ↓ / ← / →Move focus day by day or week by week
PageUp / PageDownJump by one month (add Shift for one year)
Enter / SpaceSelect the focused date

Accessibility

  • Trigger has an optional aria-label
  • Grid uses role="grid" with role="gridcell" buttons
  • Selected endpoints carry aria-selected="true"
  • Disabled dates carry aria-disabled="true"

Theming

Use sx to override the trigger. The calendar inherits popover surface styles.