Ui3nTimePicker
Inline time picker panel with configurable hour, minute and second fields. The component is not a popover input: the fields are always rendered, while the open model controls the dropdown of the active field.
v-model is a string | null in the format produced by config, for example 22:30, 22:30:15 or 07:33 PM. minuteStep and secondStep align the displayed value and may emit a normalized value on mount, so use values that already match the configured steps.
v-model:open controls the active field dropdown: setting it to true opens the hours dropdown, and false closes all dropdowns. When opening a dropdown from an external control, stop the click from bubbling to window (.stop); otherwise the menu's outside-click handler can close it during the same click event.
Props
| Name | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Root element id |
config | Ui3nTimePickerConfig | undefined | {} | Time picker display configuration |
size | Ui3nDateTimePickerSize | undefined | "regular" | Component size |
minuteStep | Ui3nTimePickerMinuteSecondStep | undefined | 5 | Step for minutes. The displayed value is aligned to the step; on mount the component emits the aligned value if it differs from `modelValue`. |
secondStep | Ui3nTimePickerMinuteSecondStep | undefined | 1 | Step for seconds. The displayed value is aligned to the step; on mount the component emits the aligned value if it differs from `modelValue`. |
modelValue* | string | null | — | Time value in the format produced by `config`, e.g. `HH:mm`, `HH:mm:ss` or `hh:mm A` |
localeConfig | Pick<Ui3nDateTimeLocaleConfig, "secondShort" | "minuteShort" | "hourShort"> | undefined | {} | Localized short labels for hours, minutes and seconds |
disabled | boolean | undefined | — | Whether all time fields are disabled |
open | boolean | undefined | false | No description provided |
Events
| Event Name | Arguments / Value Type | Description |
|---|---|---|
update:modelValue | value: string | null | — |
update:open | value: boolean | — |
CSS Variables
Set any of these where you need it — on :root, on a container, or on the element itself through [data-ui3n] — and the component follows. Leave them alone and it uses the defaults below.
| Name | Default |
|---|---|
--ui3n-time-picker-gap | 8px |
--ui3n-time-picker-padding | 8px |
Usage Examples
Basic usage
A 24-hour time picker bound to an HH:mm string.
Basic usage
Default 24-hour format with five-minute steps
12-hour format with seconds
Switches to the 12-hour format with AM/PM and displays the seconds field.
12-hour format with seconds
12-hour format with seconds and leading zeros
Custom steps and size
Uses ten-minute and five-second steps together with the large size. The initial value is aligned to both steps.
Custom steps and size
Large time picker with custom minute and second steps
Minutes and seconds only
Hides the hours field and renders only the minute and second selectors.
Minutes and seconds only
Time picker without an hours field
Leading zeros and disabled state
Shows values without leading zeros next to a fully disabled picker.
Leading zeros and disabled state
Single-digit values and a disabled time picker
Controlled open state
Binds v-model:open to a local ref and opens or closes the active field dropdown with buttons. This does not hide the inline fields.
Controlled open state
Programmatically opening and closing the active field dropdown