Time picker
VTimePicker is an inline clock for selecting hours and minutes. Its model uses 24-hour HH:mm values.
Usage
vue
Examples
Minute step
minuteStep sets the pointer and keyboard step. Only reachable minutes appear on the face.
vue
Every minute, the default
Quarter hours
What may be chosen
Use time bounds and allowed-hour or allowed-minute rules to restrict choices. An hour is unavailable when it has no allowed minute.
vue
Between 09:30 and 17:00
Nine o'clock stays open, and it is its first thirty minutes that go
Quarter hours, on three hours
The face keeps only the five minute marks a rule leaves standing
Hour format
12h shows one hour ring with AM/PM controls; 24h shows two rings. The model always uses 24 hours.
vue
format 12h
format 24h
Localization
The locale sets the hour cycle unless format overrides it.
vue
en-US, twelve hours
en-GB, twenty-four
ja-JP
API
Props
| Prop | Type | Default |
|---|---|---|
format | TimePickerFormat'12h' | '24h' | none |
| 12- or 24-hour display. Defaults to the locale; the model always uses 24 hours. | ||
locale | string | none |
BCP 47 locale for time display. Overrides the global locale; format takes precedence. | ||
minuteStep | number | 1 |
| Minute step for the clock and arrow keys. | ||
min | string | none |
Earliest allowed time, inclusive, in HH:mm format. | ||
max | string | none |
Latest allowed time, inclusive, in HH:mm format. | ||
allowedHours | TimePickerAllowed | none |
| Allowed hours: an array or predicate receiving a 24-hour value. | ||
allowedMinutes | TimePickerAllowed | none |
| Allowed minutes: an array or predicate. | ||
disabled | boolean | false |
| Disables interaction. | ||
readonly | boolean | false |
| Prevents value changes. The face remains focusable and the hour/minute display can still be switched. | ||
label | string | none |
Accessible name of the clock. Defaults to the dictionary; consumer aria-label takes precedence. | ||
v-model | string | null | null |
Time in 24-hour HH:mm format, or null. An empty clock shows midnight. | ||
Events
| Event | Type |
|---|---|
confirm | [value: string | null] |
| Keyboard confirmation of the minute selection. Receives the current time; releasing the pointer does not emit it. | |
Slots
| Slot | Type |
|---|---|
footer | {} |
| Actions below the clock. | |
Types
Types used in the API tables. Import exported types from vectis-ui.
export type TimePickerAllowed = number[] | ((value: number) => boolean)
CSS variables
| Token | Value |
|---|---|
--vectis-control-size-time-picker-dial | 16rem |
--vectis-control-size-time-picker-number | 3rem |
--vectis-control-size-time-picker-center | 0.5rem |
--vectis-control-size-time-picker-hand | 2px |
--vectis-control-size-time-picker-hand-minor | 1rem |