Skip to content
Protocore Design Systemv1.6.9

/// Inputs

TimePicker

Sunken field that opens a TimeInput plus scrollable hour / minute columns in a raised overlay for point-and-click time selection.

import { TimePicker } from "@protocore/pds";
View as Markdown

Basics

The trigger shows the formatted time; opening it reveals a TimeInput for typing plus scrollable columns for browsing. Controllable via value / defaultValue / onValueChange.

12-hour, seconds & step

Set hour12 for an AM/PM clock, withSeconds for a seconds column, and minuteStep to thin the minute column to rounded slots (e.g. every 15 minutes).

When to use it

Use TimePicker when picking a rounded slot by eye is easier than typing — a booking time, an alarm. It still embeds a TimeInput for fast keyboard entry. For a bare typed field use TimeInput; to choose a date and time together use DateTimePicker.

Usage

Do

  • Give the trigger an accessible name via a `Field` label or `aria-label`.
  • Set `minuteStep` to the granularity your booking really supports.
  • Pass a `locale` so the field value matches the surrounding UI.
  • Keep the embedded TimeInput for users who would rather type than scroll.

Don't

  • Don't use a 1-minute column for a coarse scheduling flow — the list becomes a wall.
  • Don't leave the trigger unlabelled when no visible field label wraps it.
  • Don't reformat the value in state — read the `TimeValue` from `onValueChange`.
  • Don't nest it inside another popover trigger where overlays contend for focus.

Accessibility

KeysAction
Enter / SpaceOpen the overlay from the focused trigger.
Arrow keysStep the embedded TimeInput's focused segment.
TabMove into the hour / minute columns.
EscClose the overlay without changing the value.
  • The overlay is a Radix Popover: portalled, dismissed on outside-click and Escape, and returns focus to the trigger on close.
  • Each column is a `role="listbox"` of `role="option"` buttons with `aria-selected` on the current value.
  • `invalid` sets `aria-invalid` on the trigger; the trigger exposes `aria-expanded` for its open state.

TimePicker props

PropTypeDefaultDescription
classNamestring
defaultOpenbooleanInitial open state in uncontrolled mode.
defaultValueTimeValue | nullInitial time in uncontrolled mode.
disabledbooleanDisable the whole control.
hour12booleanfalseUse a 12-hour clock.
invalidbooleanMark the field invalid — danger border plus `aria-invalid`.
localestringBCP-47 locale for the formatted field value.
minuteStepnumber5Minute (and second) column step.
onOpenChange((open: boolean) => void)Fires when the overlay opens or closes.
onValueChange((value: TimeValue | null) => void)Fires with the chosen time, or `null` while incomplete.
openbooleanControlled open state of the overlay.
placeholderstringSelect timeText shown when no time is selected.
sizeenummdField height: `sm` (32) · `md` (36, default) · `lg` (40).
styleCSSProperties
valueTimeValue | nullControlled time. Pass `null` for no selection.
withSecondsbooleanfalseInclude a seconds column + segment.

Related

  • TimeInputSegmented HH:MM(:SS) field where each part is an ARIA spinbutton — arrow keys step it and typed digits auto-advance.
  • DateTimePickerSunken field that opens a Calendar above a TimeInput in one overlay, so a date and a time are chosen together and returned as a single Date.
  • DatePickerSunken field showing a formatted date that opens a Calendar in a raised overlay for point-and-click selection.
  • FieldForm-field wrapper: a caption label, the control, and hint or error messaging with ARIA wired for you.