structyl

Date Time Picker

stable

Pick 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

bash
pnpm dlx structyl add date-time-picker

API Reference

DateTimePicker

MUI-style date-time field that selects the date first, then shows the time picker.

PropTypeDefault
value / defaultValueDate | null

Controlled or uncontrolled date-time value.

onChange / onAccept(value, context) => void

MUI-style callbacks with validation context.

minDateTime / maxDateTimeDate

Absolute date-time validation bounds.

minDate / maxDate / minTime / maxTimeDate

Separate date and time validation bounds.

ampm / minutesStep / timeStepsboolean / number / object

Time selection behavior.

shouldDisableDate / shouldDisableMonth / shouldDisableYear / shouldDisableTimevalidation callbacks

Custom validation callbacks.

views / view / openTo / onViewChangedate-time views

MUI-compatible view control props.

loading / renderLoading / format / formatDensityMUI field props

Display and loading props.

slots / slotProps / sx / viewRenderers / timezoneobject / string

MUI customization and timezone compatibility props.

DateTimePicker.Root

Compound date-time input with one controlled Date value.

PropTypeDefault
valueDate | null

Controlled date-time.

DateTimePicker.Trigger

Opens the date-time popover.

PropTypeDefault

DateTimePicker.Content

The popover with staged calendar and time controls.

PropTypeDefault

DateTimePicker.Calendar

Styled calendar bound to DateTimePicker state.

PropTypeDefault

DateTimePicker.DatePanel

Renders children only while the active view is date-based.

PropTypeDefault

DateTimePicker.TimePanel

Renders children after date selection and exposes analog time panel render props.

PropTypeDefault
childrenReactNode | (props) => ReactNode

Custom time picker panel renderer.

DateTimePicker.DateButton

Returns from the time panel to the date calendar.

PropTypeDefault

DateTimePicker.Segment

Time segment bound to DateTimePicker state.

PropTypeDefault
segment'hour' | 'minute' | 'second' | 'period'

Time unit to edit.

Date Time Picker | structyl