Segmentiertes Zeitfeld (Stunden, Minuten, optionale Sekunden, AM/PM in der durch Intl bestimmten Reihenfolge des Gebietsschemas) mit einer Popover-Liste von Zeiten im gewählten Schritt; sendet immer im 24-Stunden-Format HH:MM, formularfähig.
Kategorie
Formulare
Typ
Web Component (<mv-time-picker>)
Status
stabil
Keywords
time-picker, timepicker, time, clock, spinbutton, segmented, listbox, popover, intl, form-associated
When to use
A booking form offers appointment slots every 15 or 30 minutes within opening hours
Users type an exact time quickly, like a departure or a reminder, with arrow keys to adjust
One time field must read as 2:30 PM in the US and 14:30 in Europe while storing the same value
Avoid when
The field picks a calendar day, or a day and a time together → use Date Picker instead
A touch-first flow picks a time by flicking iOS-style drums → use Wheel Picker instead
The value is a duration like 1 h 30 min rather than a time of day → use Number Field instead
24-hour value, “HH:MM” or “HH:MM:SS”, whatever the display. Restored on form reset.
name
string
Form field name (submits the 24-hour value).
min / max
string
Earliest and latest time (“09:00”, “17:30”): bounds the list and sets rangeUnderflow / rangeOverflow.
step
number
15
Minutes between times in the list. When set explicitly, times off the grid get stepMismatch and minute arrows follow it (30: :00, :30).
seconds
boolean
Adds a seconds segment; the value becomes “HH:MM:SS”.
hour-cycle
12 | 24
Forces a 12-hour (AM/PM) or 24-hour display; by default the locale decides.
locale
string
en-US
Segment order, separators, AM/PM labels, digits and list labels (Intl.DateTimeFormat). The value auto follows the page language (nearest lang); without the attribute, en-US unless the app registered the page language with setStrings() (core/i18n.js).
required
boolean
Native validation (valueMissing); a partly filled time is badInput.
disabled
boolean
Disables the field (a disabled fieldset does too).
invalid
boolean
Forces the error style and aria-invalid.
label
string
Accessible name without a <label for>.
placement
bottom-start | top-start…
bottom-start
List popover placement (flipped when there is no room).
data-size
sm | lg
Field height.
Properties
Name
Typ
Beschreibung
value
string
24-hour value, “” while empty or incomplete.
valueAsNumber
number
Milliseconds since midnight, NaN when empty (like a native time input).
Generated parts; segments carry data-type (hour, minute, second, dayPeriod) and data-placeholder when empty.
CSS variables
Name
Standard
Beschreibung
--mv-time-picker-width
auto
Field width.
--mv-time-picker-radius
var(--mv-radius-md)
Field radius.
--mv-time-picker-list-height
15rem
Maximum height of the list before it scrolls.
Accessibility
The field is a role=group named by the <label for> (or label). Each segment is a role=spinbutton with aria-label, aria-valuemin/max/now and aria-valuetext (“Empty” when blank), all in the tab order: ↑/↓ step (wrapping), Page ↑/↓ jump, Home/End go to the bounds, digits fill and move to the next segment, ←/→ move, Backspace clears then steps back, a/p set AM/PM. Segments are contenteditable with inputmode=numeric so phones show a number pad. The clock button (aria-haspopup=listbox, aria-expanded) or Alt+↓ opens a listbox with aria-activedescendant: ↑/↓, Page ↑/↓, Home/End, typed digits jump to a time, Enter picks, Escape closes and returns focus. Forced colors use system Highlight colors. In the open list, Tab closes it and moves on to the next field, Shift+Tab closes it and goes back to the clock button. Known limits: validation messages go through the form (validationMessage, reportValidity, the browser bubble); the component shows the invalid state but no error text of its own, so place one next to it (aria-describedby is passed to every segment); the list offers times at step minutes only (no seconds), up to 1,440 entries; the picker has no time zone: the value is a wall-clock time.