Time Field
FormsA 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-fieldBasic usage
Pick a time with the platform picker; the value is a HH:MM string.
Preview
LiveTime: none
tsx
1const [value, setValue] = useState("")23<TimeField4 value={value}5 onChange={(event) => setValue(event.target.value)}6/>
With step
The step prop controls the minute granularity of the picker.
Preview
Livetsx
1<TimeField step={900} />
API reference
All props of the underlying Base UI primitive are forwarded. The table below documents the Shelf-specific props.
| Prop | Type | Description |
|---|---|---|
| value | string | The controlled time in HH:MM format. |
| onChange | ChangeEventHandler<HTMLInputElement> | Called when the time changes. |
| step | number | The minute granularity of the picker. |
| disabled | boolean= false | Disables the input. |
| className | string | Additional classes merged into the wrapper. |