Forms Form-associated
TimePicker <pm-time-picker>
Time picker: type a time ("14:30", "2:30 pm") or pick hours and minutes from a popup.
Sizes
Set with the size attribute; controls keep touch-sized targets on phones.
size="xs"size="sm"size="md"size="lg"size="xl"States
Each state is one attribute.
DisabledRead-onlyRequiredErrorOverview
12/24-hour display follows the locale (override with hour-cycle). Value is always "HH:MM" (24 h) and is submitted with forms. Columns are listboxes: ↑/↓ move, Enter picks, ←/→ switch column, Esc closes.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
mobile | boolean | — | Native mobile pattern on phones; not set means as the ancestors say, false opts out. |
min | string | — | Earliest time, "HH:MM". |
max | string | — | Latest time, "HH:MM". |
step | number | 5 | Minute step in the popup (1–60). Typed values may be any minute. |
locale | string | — | BCP 47 locale for formatting (default: the page language). |
hour-cycleprop: hourCycle | '12' | '24' | — | Force 12- or 24-hour display. |
placeholder | string | — | Hint text shown while empty (not a replacement for label). |
open | boolean | false | The popup is open. Setting it opens or closes it. |
name | string | — | Form field name: the value is submitted under it. |
value | string | — | Current value (submitted with the form). |
label | string | — | Visible label (required for accessibility; use hide-label to visually hide it). |
hint | string | — | Help text under the field, linked to it for screen readers. |
error | string | — | Custom error message. Setting it marks the control invalid. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | — | Control size. |
required | boolean | false | The form cannot be submitted until this has a value. |
disabled | boolean | false | Not interactive and not submitted. |
readonly | boolean | false | Focusable and submitted, but not editable. |
hide-labelprop: hideLabel | boolean | false | Hide the label visually; it stays the accessible name. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-open | onPmOpen | The popup opened. |
pm-close | onPmClose | The popup closed. |
pm-change | onPmChange | When the value is committed. |
Methods
show(), hide(), toggle(), close(), checkValidity(), reportValidity(), validate(), focus()