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
| Prop | Type | Default | Description |
|---|---|---|---|
value | { from: Date | null; to: Date | null } | — | Controlled range |
defaultValue | DateRange | { from: null, to: null } | Uncontrolled initial value |
onValueChange | (range: DateRange) => void | — | Called when either endpoint changes |
placeholder | string | "Pick a date range" | Trigger placeholder |
disabled | boolean | false | Disables the trigger |
minDate | Date | — | Earliest selectable date |
maxDate | Date | — | Latest selectable date |
isDateDisabled | (date: Date) => boolean | — | Return true to disable a specific date |
weekStartsOn | 0 | 1 | 0 | First 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-label | string | — | Accessible label for the trigger. The name keeps the selected range |
aria-labelledby | string | — | 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 |
sx | StyleXStyles | — | StyleX override for the trigger |
All other button attributes, such as id and aria-describedby, go to the trigger.
Keyboard
| Key | Action |
|---|---|
↑ / ↓ / ← / → | Move focus day by day or week by week |
PageUp / PageDown | Jump by one month (add Shift for one year) |
Enter / Space | Select the focused date |
Accessibility
- Trigger has an optional
aria-label - Grid uses
role="grid"withrole="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.