Skip to content

Time Picker

A popover with hour and minute columns that picks a wall time.

Daily digest time
hero.tsx

Usage guidelines

  • Use TimePicker for a wall time stored as 24-hour HH:mm, such as a daily schedule. Use DatePicker for a civil date YYYY-MM-DD and DateTimePicker for an instant (Date) shown in an IANA time zone. The pickers do not accept typed text.
  • timeZone only sets Now and the initial empty draft; it never converts the stored wall time. Parse API payloads and convert business values outside the picker.
  • Name the field at the call site: prefer one visible picker Label. It names both the trigger and the popup through aria-labelledby, and clicking its text focuses the trigger without opening it. A Label with className="sr-only" names a compact field without visible text. FieldLabel nativeLabel={false} render={<div />} also works. Do not point a native label[for] at the trigger: activating it clicks the button.
  • Without a Label, name the trigger and the content with aria-label or aria-labelledby. The trigger's name appends its visible value (or placeholder) to label text; an explicit aria-label replaces the whole name, so include the visible value in it. Put meaningful annotations inside the Value part so they join the name.
  • Name Clear explicitly: Clear follows the IconButton naming contract, so give it an aria-label such as "Clear start date". Place it next to the trigger, never inside the trigger button.
  • Use defaultValue, or value with onValueChange, and keep that choice for the field's lifetime. null means empty, and Clear emits null. details.reason is item-press, clear-press or reset; details.cancel() rejects that change and its follow-up close. Unchanged values do not emit again.
  • Edits in the popup, including Now, stay in a draft until OK. Close, Escape and an outside press discard the draft, and reopening starts from the committed value.
  • hourCycle switches between 12-hour (default) and 24-hour display; the stored value stays 24-hour. minuteStep (1, 5, 10, 15, 20 or 30) limits the minute column, and Now rounds down to that step. A value off the step counts as unavailable.
  • isTimeUnavailable checks the complete time. Unavailable drafts stay reachable while you move through the columns, but OK is disabled and the reason is announced.
  • Content keeps its natural height and flips above or below the trigger; it does not shrink on small screens. Pass maxHeight only to opt into scrolling the body while the actions stay visible.
  • locale takes an Intl locale identifier and changes formatting and digits, not the stored value. Translate action labels through labels, plus placeholders, requiredLabel and validationMessage. Direction comes from the nearest DirectionProvider; for a local RTL region, also set dir on the wrapper and on the content.
  • With name, the committed value joins native FormData, and an empty field submits ''. Inside a Field, Field.name takes precedence, validate receives the domain value, and Form.onFormSubmit receives the same strings as FormData. Required and invalid fields block submission and focus the first invalid trigger. Reset restores defaultValue. Disabled fields are left out; read-only fields open for browsing and still submit.

Anatomy

tsx
tsx

TimePickerTrigger is a native button whose default children are the Value and a decorative clock icon. When you replace them, include exactly one TimePickerValue and keep the trailing clock icon; its render callback receives the formatted text, not the raw value. TimePickerContent owns the portal, initial focus, columns and actions.

Examples

Minute step and 24-hour display

hourCycle={24} drops the period column, and minuteStep={15} offers quarter hours. The time-zone suffix lives inside TimePickerValue, so it is part of the trigger's name.

Knowledge sync time
step-24-hour.tsx

Unavailable times

isTimeUnavailable blocks business hours here. You can still move through them, but OK stays disabled until the draft is available.

Reindex window starts at

30-minute steps; 9:00 AM–5:59 PM is unavailable.

constraints.tsx

Controlled value in a form

The controlled value changes only when OK confirms the draft. Inside a Field, onFormSubmit receives the HH:mm string.

Required
Workflow run time

The workflow runs every day at this time.

Value: 08:30

form.tsx

Keyboard

KeyAction
EnterorSpaceOpens the popup from the trigger and focuses the selected hour.
Up arroworDown arrowSelects the previous or next option in the draft, stopping at the ends.
PageUporPageDownMoves the selection five options.
HomeorEndSelects the first or last option.
DigitsSelects the option that starts with the typed number.
TabMoves between the columns, Now and OK, wrapping inside the popup.
EnterorSpaceOn OK, commits the draft, closes the popup and returns focus to the trigger.
EscapeDiscards the draft, closes the popup and returns focus to the trigger.

API reference

TimePicker

Groups all parts of a wall-clock time picker storing a 24-hour HH:mm value. Doesn't render its own HTML element.

Popup edits stay in a draft until confirmed with the apply button; timeZone affects only the "Now" shortcut and initial empty draft.

Base UI Popover.Root docs

Props
PropTypeDefaultDetails
placeholderstringNo default
disabledbooleanfalse
readOnlybooleanfalse
requiredbooleanfalse
requiredLabelstring'Required'
invalidbooleanfalse
namestringNo default
formstringNo default
validationMessagestringNo default
onOpenChange((open: boolean, details: PickerOpenChangeDetails) => void)No default
children requiredReact.ReactNodeNo default
hourCycle12 | 2412
minuteStep1 | 5 | 10 | 15 | 20 | 301
valuestring | nullNo default
defaultValuestring | nullnull
onValueChange((value: string | null, details: TimePickerChangeEventDetails) => void)No default
isTimeUnavailable((value: string) => boolean)No default
localeIntl.LocalesArgument'en-US'
timeZonestringNo default
labelsPartial<TimePickerLabels>No default
Base UI Popover.Root docs

TimePickerClear

A button component that can be used to trigger actions. Renders a <button> element.

Base UI Button docs

Props
PropTypeDefaultDetails
aria-labelstringNo default
aria-labelledbystringNo default
variant'default' | 'ghost' | 'ghost-accent' | 'primary' | 'secondary' | 'secondary-accent' | 'tertiary''default'
tone'default' | 'destructive''default'
refReact.Ref<HTMLButtonElement>No default
Base UI Button docs

Valid prop combinations:

  • aria-label: string, aria-labelledby?: undefined, variant?: 'default' | 'ghost' | 'primary' | 'secondary' | 'tertiary', tone?: 'default' | 'destructive'
  • aria-label: string, aria-labelledby?: undefined, variant: 'ghost-accent' | 'secondary-accent', tone?: 'default'
  • aria-label?: undefined, aria-labelledby: string, variant?: 'default' | 'ghost' | 'primary' | 'secondary' | 'tertiary', tone?: 'default' | 'destructive'
  • aria-label?: undefined, aria-labelledby: string, variant: 'ghost-accent' | 'secondary-accent', tone?: 'default'
Data attributes
AttributeDescription
data-disabled

Present when the button is disabled.

TimePickerContent

A container for the popover contents. Renders a <div> element.

Base UI Popover.Popup docs

Props
PropTypeDefaultDetails
sideOffsetnumber | OffsetFunction8
align'center' | 'end' | 'start''start'
Base UI Popover.Popup docs
Data attributes
AttributeDescription
data-open

Present when the popup is open.

data-closed

Present when the popup is closed.

data-starting-style

Present when the popup begins animating in.

data-ending-style

Present when the popup is animating out.

data-side

Values: 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'

Indicates which side the popup is positioned relative to the trigger.

data-align

Values: 'start' | 'center' | 'end'

Indicates how the popup is aligned relative to specified side.

data-instant

Values: 'click' | 'dismiss' | 'focus' | 'trigger-change'

Present if animations should be instant.

CSS variables
VariableDescription
--popup-width

The width of the popup.

--popup-height

The height of the popup.

TimePickerLabel

Data attributes
AttributeDescription
data-disabled

Present when the component should ignore user interaction.

data-touched

Present when the field has been touched.

data-dirty

Present when the field value has changed from its initial value.

data-filled

Present when the field has a value.

data-focused

Present when the field is focused.

TimePickerTrigger

A button that opens the popover. Renders a <button> element.

Base UI Popover.Trigger docs

Props
PropTypeDefaultDetails
refReact.Ref<HTMLButtonElement>No default
Base UI Popover.Trigger docs
Data attributes
AttributeDescription
data-readonly

Present when the picker is read-only.

data-required

Present when the picker requires a value.

data-popup-open

Present when the corresponding popover is open.

data-pressed

Present when the trigger is pressed.

data-disabled

Present when the trigger is disabled.

TimePickerValue

Props
PropTypeDefaultDetails
children((displayValue: string) => React.ReactNode) | React.ReactNodeNo default