Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
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.

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/time-picker'; </script> <pm-time-picker label="Start time" value="09:30" step="15" hint="Type a time like 2:30 pm, or pick one."></pm-time-picker>

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.

Disabled
Read-only
Required
Error

Overview

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

AttributeTypeDefaultDescription
mobileboolean—Native mobile pattern on phones; not set means as the ancestors say, false opts out.
minstring—Earliest time, "HH:MM".
maxstring—Latest time, "HH:MM".
stepnumber5Minute step in the popup (1–60). Typed values may be any minute.
localestring—BCP 47 locale for formatting (default: the page language).
hour-cycle
prop: hourCycle
'12' | '24'—Force 12- or 24-hour display.
placeholderstring—Hint text shown while empty (not a replacement for label).
openbooleanfalseThe popup is open. Setting it opens or closes it.
namestring—Form field name: the value is submitted under it.
valuestring—Current value (submitted with the form).
labelstring—Visible label (required for accessibility; use hide-label to visually hide it).
hintstring—Help text under the field, linked to it for screen readers.
errorstring—Custom error message. Setting it marks the control invalid.
size'xs' | 'sm' | 'md' | 'lg' | 'xl'—Control size.
requiredbooleanfalseThe form cannot be submitted until this has a value.
disabledbooleanfalseNot interactive and not submitted.
readonlybooleanfalseFocusable and submitted, but not editable.
hide-label
prop: hideLabel
booleanfalseHide 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

EventReact / Svelte propDescription
pm-openonPmOpenThe popup opened.
pm-closeonPmCloseThe popup closed.
pm-changeonPmChangeWhen the value is committed.

Methods

show(), hide(), toggle(), close(), checkValidity(), reportValidity(), validate(), focus()