Skip to content

TimePicker

A button trigger opens a dialog with two listboxes, Hour (0023) and Minute (0059). Choosing both parts commits a"HH:MM" value to a hidden input and dispatches anink:time:change event.

Example

<TimePicker
  id="meeting"
  label="Meeting time"
  name="meeting"
/>

Click or Enter an hour, then a minute: once both parts are set the value commits ("14:30"), the dialog closes, and focus returns to the trigger. Changing either part afterwards recommits the new time immediately. "Now" fills the current time;"Clear" empties the value.

Preselected value

<TimePicker
  id="standup"
  label="Standup time"
  name="standup"
  value="09:00"
/>

A value in "HH:MM" 24-hour form preselects both columns and shows on the trigger. Malformed values select nothing.

Props

PropTypeDefaultDescription
idstring-Required. Names Field/panel/message ids (trigger itself carries no id).
labelstring-Visible label; kept in the trigger name and dialog name.
namestringidHidden-input form name; carries the "HH:MM" value.
valuestring ("HH:MM")-Preselected time; malformed values select nothing.
hideValuebooleanfalseSkips the hidden input; composition API for a combined date-time field, which owns the value.
hintstring-Help text below the trigger.
errorstring-Error message; sets aria-invalid on the trigger.
requiredbooleanfalseMarks the label required.
disabledbooleanfalseNon-interactive; trigger cannot open.
classstring-Style passthrough.

Accessibility