structyl

Time Picker

stable

A MUI-style time field with a 12-hour analog clock panel.

Basic usage

Examples

24-hour with step

Use 24-hour mode and snap minutes to 30-minute intervals.

MUI-style time field

Use the 12-hour analog clock panel with AM/PM, minutesStep, minTime, maxTime and shouldDisableTime.

12-hour analog clock with 15-minute steps between 8:00 AM and 6:00 PM.

Seconds use a separate 1-60 clock selector.

Time segments

Use segments for hour, minute and second editing with keyboard support.

09:30
14:05:45

Features

  • 1-12 hour clock.
  • AM/PM and seconds selection.
  • Min/max time validation.

Installation

bash
pnpm dlx structyl add time-picker

API Reference

TimePicker

MUI-style time field with a 12-hour analog clock panel, AM/PM selection and segmented primitive parts.

PropTypeDefault
value / defaultValueDate | TimeValue | null

Controlled or uncontrolled time.

onChange / onAccept(value, context) => void

MUI-style callbacks with validation context.

ampm / ampmInClockboolean

12-hour AM/PM mode is enabled by default in the styled picker.

minTime / maxTime / disablePast / disableFutureDate / boolean

Time validation bounds.

minutesStep / timeStepsnumber / { hours, minutes, seconds }

Clock number stepping, including optional seconds clock selection.

shouldDisableTime / skipDisabled(value, view) => boolean

Disable or hide specific clock values.

views / view / openTo / onViewChangeArray<'hours' | 'minutes' | 'seconds'>

MUI-compatible time view props.

format / formatDensity / selectedSectionsMUI field props

Formatting and field section props.

disableOpenPicker / disabled / readOnly / autoFocusboolean

Interaction and field state props.

slots / slotProps / sx / viewRenderers / timezoneobject / string

MUI customization and timezone compatibility props.

TimePicker.Root

Compound segmented time input.

PropTypeDefault
valueDate | TimeValue | null

Controlled time.

onValueChange(value: TimeValue) => void

Structyl-style segment callback.

TimePicker.Panel

Analog clock panel used by the styled TimePicker and DateTimePicker time step.

PropTypeDefault
onAccept / onCancelcallbacks

Action button callbacks.

TimePicker.Segment

An editable hour / minute / second segment.

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

Which unit this segment edits.

Time Picker | structyl