Time Field

Forms

A native time input styled to match the design system.

A styled wrapper around the native time input. The clock icon marks the field, and the value is reported as a 24-hour HH:MM string.

npx shadcn@latest add time-field

Basic usage

Pick a time with the platform picker; the value is a HH:MM string.

Preview
Live

Time: none

tsx
1const [value, setValue] = useState("")
2
3<TimeField
4 value={value}
5 onChange={(event) => setValue(event.target.value)}
6/>

With step

The step prop controls the minute granularity of the picker.

Preview
Live
tsx
1<TimeField step={900} />

API reference

All props of the underlying Base UI primitive are forwarded. The table below documents the Shelf-specific props.

PropTypeDescription
valuestringThe controlled time in HH:MM format.
onChangeChangeEventHandler<HTMLInputElement>Called when the time changes.
stepnumberThe minute granularity of the picker.
disabledboolean= falseDisables the input.
classNamestringAdditional classes merged into the wrapper.