Time Picker
A time typed in a field (hours, minutes, seconds) or picked from slots between two hours, in 12 or 24 hours.
Type it, or use the arrow keys.
Every 30 minutes, 9:00 to 17:30.
Installation
Or with the shadcn CLI, from the registry:
Usage
Two ways to ask for a time, both valued "HH:mm":
TimeInputis the browser's own time field in an Input Group: typed segment by segment, in the locale's 12 or 24 hours, with a native picker on phones.TimePickeris a Select of slots frommintomax, everyintervalminutes: opening hours, appointments.
Both are Field controls, so a FieldLabel names them and they take the Field's size and variant.
Seconds, 12 or 24 hours
step under 60 adds the seconds to TimeInput ("HH:mm:ss"). TimePicker labels its slots in the locale's hour
cycle, or the one you set with hourCycle={12} or {24}.
Slots beside a calendar
timeSlots({ min, max, interval }) returns the slots with their labels, to lay out yourself: here as toggle
buttons (aria-pressed) beside a Calendar, for a booking.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Fri, Jun 12
For a day and a time together, use DateTimePicker.
Villages
TimeInput is Input's field and TimePicker Select's, in every village.
Type it, or use the arrow keys.
Every 30 minutes, 9:00 to 17:30.
Type it, or use the arrow keys.
Every 30 minutes, 9:00 to 17:30.
Type it, or use the arrow keys.
Every 30 minutes, 9:00 to 17:30.
Type it, or use the arrow keys.
Every 30 minutes, 9:00 to 17:30.
Type it, or use the arrow keys.
Every 30 minutes, 9:00 to 17:30.
Type it, or use the arrow keys.
Every 30 minutes, 9:00 to 17:30.
Accessibility
TimeInputis a native time input: screen readers announce each segment, and the arrow keys change it.TimePickeris Base UI's select: type a time's first characters to jump to it, Enter picks.- Taken slots in your own layouts should be disabled, not only greyed, so the keyboard skips them.
API reference
| Component | Props |
|---|---|
TimeInput | Input's props (value, defaultValue, onChange, min, max, step, name…), plus Input Group's variant and size, and groupClassName |
TimePicker | value, defaultValue, onValueChange ("HH:mm" | null), min, max, interval (30), hourCycle, locale, placeholder, name, id, disabled, Select's variant and size |
timeSlots({ min, max, interval, locale, hourCycle }) returns { value, label }[].