Ui3nInputTime
Text input with a popover time picker. The calendar-clock icon in the append slot opens Ui3nTimePicker; the input itself supports masked typing.
v-model is a string | null in the format produced by config: 22:30, 22:30:15 or 07:33 PM. The value is masked by default (masked), and mask can override the IMask options. leadingZeros: false disables the fixed mask, so the field accepts free-form values. maskValueMode controls whether v-model, input, change and validation rules receive the padded string (masked, default) or digits without separators (unmasked).
Typed values are not normalized on every keystroke. When the panel opens, the time picker aligns the current value to minuteStep / secondStep once (the same behavior as the standalone picker), so start with a value that already matches the configured steps when that matters.
The panel stays open after a selection and closes on an outside click. rules validate the value shown in the input, while input and change emit strings. The mask works only for type="text"; maxlength and minlength are ignored while a mask is active.
Props
| Name | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Root element id |
label | string | undefined | — | No description provided |
placeholder | string | undefined | — | No description provided |
clearable | boolean | undefined | — | No description provided |
autofocus | boolean | undefined | — | No description provided |
readonly | boolean | undefined | — | No description provided |
name | string | undefined | — | No description provided |
rules | ((v: unknown) => string | boolean)[] | undefined | — | No description provided |
validateAtStartup | boolean | undefined | — | No description provided |
hideBottomSpace | boolean | undefined | — | No description provided |
displayStateMode | "error" | "success" | undefined | — | No description provided |
displayStateWithIcon | boolean | undefined | — | No description provided |
displayStateMessage | string | undefined | — | No description provided |
config | Ui3nTimePickerConfig | undefined | — | Time picker display configuration |
size | Ui3nDateTimePickerSize | undefined | — | Component size |
minuteStep | Ui3nTimePickerMinuteSecondStep | undefined | — | 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 | — | 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 |
masked | boolean | undefined | true | Whether to apply the input mask derived from `config`. Ignored when `config.leadingZeros` is false, because the format is not fixed then. |
mask | FactoryArg | — | Custom IMask options that override the mask derived from `config`. |
maskValueMode | Ui3nInputMaskValueMode | undefined | "masked" | Which value is emitted through `update:modelValue`, `input` and `change`. |
Events
| Event Name | Arguments / Value Type | Description |
|---|---|---|
update:modelValue | value: string | null | — |
clear | | — |
init | value: HTMLInputElement | — |
focus | value: Event | — |
blur | value: Event | — |
change | value: string | — |
input | value: string | — |
keydown | value: KeyboardEvent | — |
open-picker | | — |
close-picker | | — |
update:valid | value: boolean | — |
Public Methods & Exposes
| Method Name | Signature / Type | Description |
|---|---|---|
inputElement() | HTMLInputElement | null | undefined | Reference to the input DOM element |
isDirty() | boolean | undefined | Whether the input has been modified |
isFocused() | boolean | undefined | Whether the input is currently focused |
clearValue() | (() => void) | undefined | Clear the input value |
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-input-time-background-color | var(--color-bg-block-primary-default) |
--ui3n-input-time-border-radius | 16px |
--ui3n-input-time-width | 200px |
--ui3n-input-time-width-3 | 280px |
--ui3n-input-time-z-index | 1000 |
Usage Examples
Basic usage
A 24-hour masked time input bound to an HH:mm string.
Basic usage
Default 24-hour format with five-minute steps
12-hour format with seconds
Switches the field and the picker to the 12-hour format with AM/PM and seconds.
12-hour format with seconds
12-hour format with seconds and a large input
Custom steps and size
Uses one-minute and five-second steps with the large size. The initial value is aligned to both steps.
Custom steps and size
Large input with custom minute and second steps
Mask and free input
The left field uses the default mask. The right one sets leadingZeros: false, which disables the fixed mask and allows single-digit hours, minutes and seconds.
Mask and free input
Masked typing versus free input without leading zeros
Validation and clearable
Passes rules to the underlying input and validates the working-hours range. Use the clear button to see the required rule.
Validation and clearable
Rules validating the displayed time and a clear button
States and sizes
Shows the regular, large, disabled and readonly states side by side.
States and sizes
Regular, large, disabled and readonly time inputs