Date Time Picker
stablePick a date first, then choose the time from one popover with MUI-style props.
Basic usage
Select the date, then choose the time.
Examples
With AM/PM and helper text
Enable 12-hour clock and guide the user with helper text.
Pick the date and then the time.
MUI-style date time field
Pick the date first, then choose the time from the staged time picker.
Date and time validation share one Date value.
AM/PM with seconds
Enable AM/PM and seconds while keeping the date-first, time-second flow.
After selecting a date, the time picker shows hours, minutes and seconds.
Features
- Date-first time picker flow.
- Min/max date-time validation.
- AM/PM and seconds support.
Installation
pnpm dlx structyl add date-time-pickerAPI Reference
DateTimePicker
MUI-style date-time field that selects the date first, then shows the time picker.
| Prop | Type | Default |
|---|---|---|
| value / defaultValue | Date | nullControlled or uncontrolled date-time value. | — |
| onChange / onAccept | (value, context) => voidMUI-style callbacks with validation context. | — |
| minDateTime / maxDateTime | DateAbsolute date-time validation bounds. | — |
| minDate / maxDate / minTime / maxTime | DateSeparate date and time validation bounds. | — |
| ampm / minutesStep / timeSteps | boolean / number / objectTime selection behavior. | — |
| shouldDisableDate / shouldDisableMonth / shouldDisableYear / shouldDisableTime | validation callbacksCustom validation callbacks. | — |
| views / view / openTo / onViewChange | date-time viewsMUI-compatible view control props. | — |
| loading / renderLoading / format / formatDensity | MUI field propsDisplay and loading props. | — |
| slots / slotProps / sx / viewRenderers / timezone | object / stringMUI customization and timezone compatibility props. | — |
DateTimePicker.Root
Compound date-time input with one controlled Date value.
| Prop | Type | Default |
|---|---|---|
| value | Date | nullControlled date-time. | — |
DateTimePicker.Trigger
Opens the date-time popover.
| Prop | Type | Default |
|---|
DateTimePicker.Content
The popover with staged calendar and time controls.
| Prop | Type | Default |
|---|
DateTimePicker.Calendar
Styled calendar bound to DateTimePicker state.
| Prop | Type | Default |
|---|
DateTimePicker.DatePanel
Renders children only while the active view is date-based.
| Prop | Type | Default |
|---|
DateTimePicker.TimePanel
Renders children after date selection and exposes analog time panel render props.
| Prop | Type | Default |
|---|---|---|
| children | ReactNode | (props) => ReactNodeCustom time picker panel renderer. | — |
DateTimePicker.DateButton
Returns from the time panel to the date calendar.
| Prop | Type | Default |
|---|
DateTimePicker.Segment
Time segment bound to DateTimePicker state.
| Prop | Type | Default |
|---|---|---|
| segment | 'hour' | 'minute' | 'second' | 'period'Time unit to edit. | — |