Time picker
Help people enter or select a time from a list with a time picker and keyboard controls.
Examples
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxComponent API
TimePicker uses the Combobox parts. Root supplies half-hour options and time-aware filtering by default; pass options to replace the generated list.
Root<div>
Manages time selection, query text, filtering, and list visibility.
| Prop | Type | Default | Description |
|---|---|---|---|
options | { value: string; label: string }[] | — | Replaces the generated half-hour time options. |
defaultValue | string | — | Initial selected time. |
onValueChange | ({ value, label }) => void | — | Receives the selected time value and its visible label. |
disableFiltering | boolean | — | Shows supplied options without filtering. |
disabled | boolean | false | Disables selection. |
required | boolean | — | Requires a value. |
showClearButton | boolean | true | Renders the clear button when true. |
showToggleButton | boolean | true | Renders the toggle button when true. |
| Attribute | Value | Purpose |
|---|---|---|
data-state | open | closed | Style the open and closed states. |
data-disabled | Present when disabled | Style the disabled state. |
Label<label>
Names the time field.
Control<div>
Groups the input and buttons.
Input<input>
Receives a typed time query.
List<ul>
Displays matching time options.
| Prop | Type | Description |
|---|---|---|
children | ReactNode | ({ options }) => ReactNode | Renders items from the filtered options or supplied children. |
| Attribute | Value | Purpose |
|---|---|---|
data-state | open | closed | Style the open and closed states. |
Item<li>
Spread a rendered option onto Item, including its generated id, value, and label.
| Prop | Type | Description |
|---|---|---|
id | string (required) | Generated ID from the rendered option. |
value | string (required) | Option value. |
label | string (required) | Option label. |
| Attribute | Value | Purpose |
|---|---|---|
aria-selected | true | false | Styles the selected option. |
data-highlighted | Present when highlighted | Styles the highlighted option. |
EmptyItem<li>
Displays when no option matches.
IndicatorGroup<div>
Groups clear and toggle buttons.
ClearButton<button>
Clears the selected time.
ToggleButton<button>
Opens or closes the option list.
Accessibility
Provide a visible Label or another accessible name. Keep Item indices aligned with the filtered options passed to List.