Date Picker
stableA calendar inside a popover for picking a date.
Basic usage
Examples
Controlled with min/max
Restrict selectable dates to a valid booking window.
MUI-style field
Use the direct component API for label, value, onChange, validation bounds, view props and helper text.
Only dates inside the release window can be selected.
Validation and loading
Mirror MUI validation props such as disablePast, shouldDisableDate, loading and renderLoading.
Weekends and past dates are disabled.
Date picker field
DatePicker combines a trigger, value display and calendar popover.
Features
- MUI-style field API.
- Popover-anchored calendar.
- Controlled or uncontrolled.
Installation
pnpm dlx structyl add date-pickerAPI Reference
DatePicker
MUI-style date field with label, trigger and calendar popover.
| Prop | Type | Default |
|---|---|---|
| value / defaultValue | Date | nullControlled or uncontrolled date value. | — |
| onChange / onAccept | (value, context) => voidMUI-style callbacks with validationError, source and shortcut metadata. | — |
| onError | (error, value) => voidCalled when validation error state changes. | — |
| open / onOpen / onClose | boolean / callbacksControlled popover state and lifecycle callbacks. | — |
| label / name / inputRef | React.ReactNode / string / refField label and form integration props. | — |
| format / formatDensity | string | Intl.DateTimeFormatOptionsInput display format and dense/spacious separator density. | — |
| minDate / maxDate / disablePast / disableFuture | Date / booleanDate validation bounds. | — |
| shouldDisableDate / shouldDisableMonth / shouldDisableYear | (date: Date) => booleanCustom date, month and year validation callbacks. | — |
| views / view / openTo / onViewChange | Array<'day' | 'month' | 'year'>MUI-compatible view control props. | — |
| selectedSections / onSelectedSectionsChange | FieldSelectedSectionsMUI-compatible field section selection props. | — |
| loading / renderLoading | boolean / () => ReactNodeRender a loading state instead of the calendar. | — |
| dayOfWeekFormatter / displayWeekNumber / fixedWeekNumber / showDaysOutsideCurrentMonth | calendar propsCalendar rendering options. | — |
| disableOpenPicker / disabled / readOnly / autoFocus | booleanInteraction and field state props. | — |
| desktopModeMediaQuery / orientation / reduceAnimations / referenceDate / timezone | MUI compatibility propsAccepted for API parity. | — |
| slots / slotProps / sx / viewRenderers | objectMUI customization props accepted by the component surface. | — |
DatePicker.Root
Compound date input — Calendar inside a Popover.
| Prop | Type | Default |
|---|---|---|
| value | Date | nullControlled date. | — |
| onValueChange | (date?: Date) => voidStructyl-style change callback. | — |
DatePicker.Trigger
The button that opens the calendar.
| Prop | Type | Default |
|---|
DatePicker.Content
The popover containing the calendar.
| Prop | Type | Default |
|---|---|---|
| children | React.ReactNodeCustom calendar content. Defaults to DatePicker.Calendar. | — |
DatePicker.Calendar
Styled calendar bound to DatePicker state.
| Prop | Type | Default |
|---|