Searching Puzzle Pieces

Type to search Puzzle Pieces.

Time Picker

A Field-shaped trigger and popover for choosing a time: scrolling hour / minute (and optional seconds) listbox columns, with a 12-hour am/pm or 24-hour display. The controlled value is always stored as a 24-hour "HH:MM" string — display format never leaks into it. It is parent-owned: it emits @change on every column pick.

24-hour clock.

Focus lands in the hours column on open. Arrow up/down moves within a column, arrow left/right jumps between columns, and the popover auto-flips above the trigger near the bottom of the viewport.

Installation

Copy the picker into your components directory — it ships self-contained (no lib dependency, no npm packages):

puzzle add piece time-picker

Usage

import TimePicker from '@/components/ui/TimePicker.pzl';
<TimePicker label="Meeting time" hint="24-hour clock." value={ meeting } @change={ setMeeting } />

12-hour (am/pm)

With seconds

Minute step

Controlled open

Panel is closed · value 18:20

Error state

Please choose a start time.

Keyboard

↑ / ↓Move the highlighted option within the focused column.
← / →Move focus between the hour, minute, second, and am/pm columns.
Home / EndJump to the first / last option in the focused column.
Enter / SpaceConfirm the current time and close, returning focus to the trigger.
EscapeClose the popover and return focus to the trigger.