Skip to content

Forms

ITimeField

A time entered one segment at a time — hour, minute, optionally seconds — each its own arrow-key control.

9
:
00
AM

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.

ts
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

9
:
00
AM
9
:
30
:
00
AM

Hour cycle

Left unset it follows the locale. The model stays 24-hour either way.

2
:
15
PM
14
:
15

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.

10
:
00
AM

Sizes and states

9
:
00
AM
9
:
00
AM
9
:
00
AM
11
:
59
PM
9
:
00
AM

Inside an IFormField the id, the invalid state and the error's aria-describedby are all inherited.

Props

PropTypeDefaultDescription
modelValuestring | nullHH:mm or HH:mm:ss, 24-hour
granularity'hour' | 'minute' | 'second''minute'
hourCycle12 | 24from localeDisplay only; the model stays 24-hour
localestringbrowser default
step{ hour?, minute?, second? }1 eachMovement per arrow key press
minValuestring
maxValuestring
size'sm' | 'md' | 'lg''md'
disabledbooleanfalse
readonlybooleanfalse
invalidbooleanInherited from IFormField when unset
unstyledbooleanSkip 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.