Skip to content
Theme:

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

NameTypeDefaultDescription
idstring | undefined —

Root element id

labelstring | undefined — No description provided
placeholderstring | undefined — No description provided
clearableboolean | undefined — No description provided
autofocusboolean | undefined — No description provided
readonlyboolean | undefined — No description provided
namestring | undefined — No description provided
rules((v: unknown) => string | boolean)[] | undefined — No description provided
validateAtStartupboolean | undefined — No description provided
hideBottomSpaceboolean | undefined — No description provided
displayStateMode"error" | "success" | undefined — No description provided
displayStateWithIconboolean | undefined — No description provided
displayStateMessagestring | undefined — No description provided
configUi3nTimePickerConfig | undefined —

Time picker display configuration

sizeUi3nDateTimePickerSize | undefined —

Component size

minuteStepUi3nTimePickerMinuteSecondStep | 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`.

secondStepUi3nTimePickerMinuteSecondStep | 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`

localeConfigPick<Ui3nDateTimeLocaleConfig, "secondShort" | "minuteShort" | "hourShort"> | undefined —

Localized short labels for hours, minutes and seconds

disabledboolean | undefined —

Whether all time fields are disabled

maskedboolean | undefinedtrue

Whether to apply the input mask derived from `config`. Ignored when `config.leadingZeros` is false, because the format is not fixed then.

maskFactoryArg —

Custom IMask options that override the mask derived from `config`.

maskValueModeUi3nInputMaskValueMode | undefined"masked"

Which value is emitted through `update:modelValue`, `input` and `change`.

Events

Event NameArguments / Value TypeDescription
update:modelValuevalue: string | null —
clear —
initvalue: HTMLInputElement —
focusvalue: Event —
blurvalue: Event —
changevalue: string —
inputvalue: string —
keydownvalue: KeyboardEvent —
open-picker —
close-picker —
update:validvalue: boolean —

Public Methods & Exposes

Method NameSignature / TypeDescription
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.

NameDefault
--ui3n-input-time-background-colorvar(--color-bg-block-primary-default)
--ui3n-input-time-border-radius16px
--ui3n-input-time-width200px
--ui3n-input-time-width-3280px
--ui3n-input-time-z-index1000

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