Forms
Time picker
Pick a time with the keyboard or a list.
Usage
Hour, minute and AM/PM are separate segments, like a native time input. Type digits (they move on by themselves), step with the arrow keys, clear with Backspace. Add step for a list of times to pick from; the current time is scrolled into view.
Stand-up starts at 09:30 (24-hour value).
When to use
- A time of day in a form: a meeting, a pickup, opening hours.
- Slots on a regular grid — add
stepand bound them withminandmax. - Exact times such as 09:47 — the segments take any minute, with or without the list.
Not for: a duration (use a number input), a date and time together (pair a DatePicker with a TimePicker), or a free-form schedule (use your own scheduler).
Opening hours
Two pickers per row, each bounded by min and max. A value outside the bounds, or a closing time before opening, marks the field invalid.
Monday – Friday
Open 8:00 AM – 6:00 PM
Saturday
Open 10:00 AM – 2:00 PM
12 or 24 hours, seconds
The locale decides the clock: en-US is 12-hour with AM/PM, de-DE is 24-hour. Force one with hour12. seconds adds a third segment. The value is always a 24-hour string — HH:mm or HH:mm:ss — and null until every segment is filled.
Zürich HB → München Hbf. The value is always “HH:mm”.
With seconds: arrow keys step, digits move on by themselves.
API
TimePicker
| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue | string | null | — | "HH:mm" ("HH:mm:ss" with seconds). Controlled or uncontrolled. |
| onValueChange | (value: string | null) => void | — | Called as soon as every segment is filled, and with null when one is cleared. |
| locale | string | 'en-US' | Decides 12 or 24 hours and the AM/PM words. |
| hour12 | boolean | — | Force a 12-hour or 24-hour clock. |
| seconds | boolean | false | Show a seconds segment. |
| step | number | — | Minutes between times in the popover list. Without it there is no list. |
| min / max | string | — | "HH:mm" bounds for the list; a value outside them is flagged invalid. |
| open / defaultOpen / onOpenChange | boolean | — | Control the list popover. |
| clearable | boolean | true | Clear button while anything is filled in. |
| disabled / required | boolean | — | Also follow the surrounding Field. |
| name | string | — | Hidden input name; submits HH:mm. |
| size | 'sm' | 'md' | 'lg' | 'md' | Height: 32 / 36 / 44px. |
| labels | TimePickerLabels | — | Accessible names: hour, minute, second, period, clear, open, list. |
| ...props | HTMLAttributes<HTMLDivElement> | — | Forwarded to the field (role="group"); give it an aria-label. |
Helpers: parseTimeValue, formatTimeValue, formatTimeLabel, buildTimeOptions and resolveHour12 are exported.
Keyboard
| Key | Action |
|---|---|
| 0–9 | Fill the segment; moves on once the number is complete. |
| Arrow Up / Down | Step the segment, wrapping around. On AM/PM: toggle. |
| Arrow Left / Right | Previous / next segment. |
| Home / End | Lowest / highest value of the segment. |
| A / P | On AM/PM: choose AM or PM. |
| Backspace / Delete | Clear the segment; Backspace on an empty one goes back. |
| : . , Space | Next segment. |
| Alt + Arrow Down | Open the list of times. |
| List: Arrows, Home, End | Move through the times; Enter or Space picks, Esc closes. |
Accessibility
- The field is a group; every segment is a spinbutton with a name, min, max, now and text value.
- The list is a listbox of options with aria-selected; its button reports aria-expanded.
- Soft keyboards work: the typed character is read from the input event when no key code arrives.
- Keyboard focus shows a 3px ring on the whole field and fills the active segment.
Motion
- The list rises in like every popover and leaves faster; the highlight on a segment fades in 150ms.
- No press scale on the list button, because it opens a popup.
- Reduced motion: the list only fades.