Date Range Picker
stablePick a start and end date from a popover calendar.
Basic usage
Examples
Controlled range
Track the selected date range externally for form submission.
MUI-style range field
Use tuple values for MUI parity or the Structyl range object for compound usage.
Range closes after both start and end dates are selected.
Preset shortcuts
Use built-in shortcut buttons or provide your own shortcut ranges.
Shortcut selections call onChange and onAccept with source='shortcut'.
Date range field
Use DateRangePicker for reporting windows, bookings and project timelines.
Features
- MUI-style tuple values.
- Range selection.
- Popover-anchored.
Installation
pnpm dlx structyl add date-range-pickerAPI Reference
DateRangePicker
MUI-style range field with tuple values and calendar popover.
| Prop | Type | Default |
|---|---|---|
| value / defaultValue | [Date | null, Date | null] | { from?: Date; to?: Date }Controlled or uncontrolled range. | — |
| onChange / onAccept | (range, context) => voidMUI-style callbacks with validation context. | — |
| shortcuts | DateRangePickerShortcut[] | falsePreset action buttons. Defaults include Today, Yesterday, Last 7 days, Last 30 days, This month and Last month. | — |
| calendars / currentMonthCalendarPosition | 1 | 2 | 3Visible month count and current month placement compatibility. | — |
| rangePosition / defaultRangePosition / onRangePositionChange | 'start' | 'end'Controlled edited edge of the range. | — |
| minDate / maxDate / disablePast / disableFuture | Date / booleanDate validation bounds. | — |
| shouldDisableDate | (date: Date, position: 'start' | 'end') => booleanCustom disabled-date predicate with range edge. | — |
| disableAutoMonthSwitching / disableDragEditing | booleanMUI range behavior compatibility props. | — |
| format / formatDensity / selectedSections | MUI field propsFormatting and field section props. | — |
| loading / renderLoading | boolean / () => ReactNodeRender loading state. | — |
| displayWeekNumber / fixedWeekNumber / showDaysOutsideCurrentMonth | calendar propsCalendar rendering options. | — |
| slots / slotProps / sx / viewRenderers / timezone | object / stringMUI customization and timezone compatibility props. | — |
DateRangePicker.Root
Compound date-range input — Calendar in a Popover.
| Prop | Type | Default |
|---|---|---|
| value | { from?: Date; to?: Date } | [Date | null, Date | null]Controlled range. | — |
| onValueChange | (range) => voidStructyl-style change callback. | — |
DateRangePicker.Trigger
Opens the calendar.
| Prop | Type | Default |
|---|
DateRangePicker.Content
The popover with the range calendar.
| Prop | Type | Default |
|---|---|---|
| calendars | 1 | 2Number of visible months. | — |
DateRangePicker.Calendar
Styled range calendar bound to DateRangePicker state.
| Prop | Type | Default |
|---|