Forms
ITimeField
A time entered one segment at a time — hour, minute, optionally seconds — each its own arrow-key control.
Value: 09:00
The model is a string
HH:mm, or HH:mm:ss when there are seconds — on a 24-hour clock, zero-padded, and carrying no date or time zone. Padded that way it sorts and compares as a plain string.
const start = ref('09:00') // not new Date(...)
const exact = ref('09:30:15') // with granularity="second"A malformed value is treated as no selection rather than an error, so a stale draft or a URL parameter cannot break the render.
Granularity
Hour cycle
Left unset it follows the locale. The model stays 24-hour either way.
Both hold: 14:15
Bounds and steps
min-value and max-value take the same HH:mm form. step sets how far each arrow key press moves a segment.
Sizes and states
Inside an IFormField the id, the invalid state and the error's aria-describedby are all inherited.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | null | — | HH:mm or HH:mm:ss, 24-hour |
granularity | 'hour' | 'minute' | 'second' | 'minute' | |
hourCycle | 12 | 24 | from locale | Display only; the model stays 24-hour |
locale | string | browser default | |
step | { hour?, minute?, second? } | 1 each | Movement per arrow key press |
minValue | string | — | |
maxValue | string | — | |
size | 'sm' | 'md' | 'lg' | 'md' | |
disabled | boolean | false | |
readonly | boolean | false | |
invalid | boolean | — | Inherited from IFormField when unset |
unstyled | boolean | — | Skip built-in classes |
ui | { root?, segment?, literal? } | — | Per-slot class overrides |
Helpers
toTime() and toIsoTime() are exported for converting at your own boundaries — see the date helpers.
Accessibility
Each segment is a spinbutton: arrow keys change it, left and right move between segments, and typing digits fills it and advances. A screen reader announces each part by name rather than reading one opaque string.
The separator between segments is plain text rather than another stop on the way through the field, and the digits are tabular so the segments do not jitter while they change.