Passer au contenu principal

TimePicker

Implemented

Typeable time combobox over a 15-minute grid (separate from date). Used for event start time, doors time, and any range with min/max. E11-INTK-1 rewrite — the list opens on click/focus and the field accepts free text (`7:30 pm`, `1930`, `19:30` all normalise to `19:30`). Out-of-range options are GREYED rather than hidden so the producer sees the constraint.

Categorymolecules
Sourcepatterns/molecules/timepicker.html
AI HintUse whenever a form needs a time that can be typed AND picked from a constrained grid. For raw date-only or datetime-local inputs without constraints, prefer the native DatePicker or a plain `<input type='datetime-local'>`.

TimePicker component.

TimePicker

design-system

TimePicker component preview and API reference.

Props

Preview

TimePicker

Prop
Type
Required
Default
Description
value
string
Optional
—

Selected time in `HH:MM` (24h) — controlled.

onChange
(value: string) => void
Optional
—

Time change handler — omitted renders a read-only field.

format
'12' | '24'
Optional
'24'

Display format. Values are stored in 24h `HH:MM` regardless.

disabled
boolean
Optional
false

Disabled state — closes the list and blocks typing.

label
string
Optional
—

Visible field label.

ariaLabel
string
Optional
—

Override the input's aria-label (falls back to `label`).

className
string
Optional
—

Extra classes for the outer wrapper.

id
string
Optional
—

Explicit id (otherwise auto-generated via React.useId).

min
string | null
Optional
—

Earliest selectable time (`HH:MM`). Out-of-range options greyed; typed values outside the range are still accepted — validation belongs to the form.

max
string | null
Optional
—

Latest selectable time (`HH:MM`). Same greyed-not-hidden semantics as `min`.

stepMinutes
number
Optional
15

Minutes between offered options.

placeholder
string
Optional
—

Shown when the field is empty.

Quick use:<TimePicker />

Accessibility

ARIA rolecombobox

ARIA

2 rules

WAI-ARIA APG (Combobox pattern)

Input is role=combobox with aria-haspopup=listbox; listbox opens with aria-expanded

WAI-ARIA APG

Out-of-range options carry aria-disabled and are skipped by ArrowUp/ArrowDown

validation

1 rule

ISO 8601

Stored value is HH:MM (24h); free-text entry accepts `HH:MM`, `HH:MM AM/PM`, or `HHMM`

Keyboard

1 rule

WCAG 2.1.1

ArrowUp/ArrowDown step through SELECTABLE options; Enter commits typed text; Escape closes

a11y

1 rule

DS h-10 + ring-ep-primary

Input height and focus ring match DatePicker — Date/Time pairs stay aligned

Usage

Import

tsxSnippet
import { TimePicker } from "@epasslive/design-system"

Example 1

tsxSnippet
<TimePicker label='Doors' value={value} onChange={setValue} />

Example 2

tsxSnippet
<TimePicker label="Ends" value={value} onChange={setValue} min={startsAt} />

Example 3

tsxSnippet
<TimePicker value={value} onChange={setValue} format='12' />

Anti-patterns

— Do not hardcode data in molecules

— Avoid complex business logic in molecules

Design System v4.1.0 | ePassLive