Forms

TimeInput

A time or time-range picker.

html
<UiTimeInput />

Model value

modelValue is the selected time, carried as a real Date — the date part comes along but only the time is read — or a { start, end } object once range is set. Pass it to control the selection yourself; the trigger's text is formatted from it, so there's no separate string to keep in step.

Selected: nothing

Default value

defaultValue is the time the picker starts on while it still owns its own state — the top of the next hour, the start of a working day, whatever saves the reader a scroll.

Placeholder

placeholder is what the trigger reads before a time is chosen, defaulting to “Select a time”. Naming what the time is for — a start, an end, a reminder — is worth more here than restating the control.

Disabled

disabled switches off the trigger so the picker can't open — for a time that's fixed by something else, or a form that's saving.

Clearable

clearable adds a button that resets the selection to null. Add it wherever “no time” is a real answer — an optional reminder, an open-ended slot — and leave it off where a value is required.

Variant

variant picks between the ringed outline trigger on the page background and the filled, ringless soft one, which has its own section below.

Icon

icon is the glyph in the trigger, timer by default. Change it to distinguish two time fields sitting side by side, or to match an icon set you use for scheduling elsewhere.

Format

format forces the twelve- or twenty-four-hour clock. Left unset it follows locale, which is usually what you want — set it only where the convention comes from the content rather than the reader, such as a log viewer that's always in 24h.

12h
24h

Minute step

minuteStep is the gap between the minute options offered, five by default. Widen it to fifteen or thirty for something booked in slots — it shortens the list as much as it constrains the answer, which is the real benefit on a small screen.

Range

range switches the picker to a start and an end instead of a single time, which also changes modelValue to a { start, end } object.

Locale

locale is the BCP 47 tag used to format the displayed time, and — when format is left unset — to decide between the twelve- and twenty-four-hour clock. Setting it alone is usually enough; format is the override for when it isn't.

Content

content positions the picker popover relative to the field: side, align and sideOffset. Reach for it when the field sits low on the page, where the list would otherwise open past the fold.

Open

open controls whether the picker popover is showing. Pass it to drive the list from your own state and bind it with v-model:open so the trigger still works; omit it and the component manages that itself.

Default open

defaultOpen starts the picker expanded on mount while leaving the open state uncontrolled — reasonable on a step whose only question is the time, disruptive anywhere the field is one of several.

Select a time

`variant="soft"`

A filled, tinted background with no ring.

Wrapped in `FormField`


API Reference

Generated from the component's source — props, slots and emits as the component actually declares them.

Props

Prop
Type
Default
Description
Date | TimeRangeValue | null
The controlled selected time (or time range when `range` is set). Omit this to let the component manage its own value internally (starting from `defaultValue`); pass it to fully control it yourself.
Date | TimeRangeValue | null
Initial value when uncontrolled.
string
'Select a time'
Placeholder text shown in the trigger when no time is selected.
boolean
false
Disables the trigger, preventing the picker from opening.
boolean
false
Shows a button to clear the selected value.
"outline" | "soft"
'outline'
Visual style of the trigger.
string
'timer'
Icon displayed in the trigger.
"12h" | "24h"
derived from locale
number
5
Interval, in minutes, between selectable minute options.
boolean
false
Enables selecting a start and end time instead of a single time.
string
Locale used to format the displayed time and to derive the default hour format when `format` is unset.
TimeInputContentProps
{ align: 'start', side: 'bottom', sideOffset: 8 }
Positioning options for the picker popover.
boolean
Controls whether the picker popover is open. Omit this to let the component manage its own open state internally (starting from `defaultOpen`); pass it to fully control it yourself.
boolean
false
Initial open state when uncontrolled.

Emits

Event
Payload
Description
update:modelValue
[value: ModelValue]
update:open
[value: boolean]

Types

ts
type Period = "AM" | "PM";
ts
type Leg = "start" | "end";
ts
type ModelValue = Date | TimeRangeValue | null;
ts
interface TimeRangeValue {
    start: Date | null;
    end: Date | null;
}
ts
interface TimeInputContentProps {
    align?: "start" | "center" | "end";
    side?: "bottom" | "top";
    sideOffset?: number;
}