inputshwcz-input-time

Time Input

Segmented hour/minute time field with 12h/24h clocks, meridiem toggle, and min/max validation.

Attributes

AttributeTypeDefaultDescription
autofocusbooleanfalseFocuses the hour field on mount.
nowbooleanfalseInitializes the value to the current time.
clock'12h' | '24h''12h'Clock notation: 12h (default, with AM/PM toggle) or 24h.
minstring''Earliest allowed time (HH:MM), validated on commit.
maxstring''Latest allowed time (HH:MM), validated on commit.
Inherited from InputMixin
AttributeTypeDefaultDescription
disabledbooleanfalseDisables the control so it cannot be interacted with.
formstring''Associates the hidden form input with a form by id, even when the component sits outside that form.
namestring''Field name for the hidden form input; array values submit as name[].
placeholderstring''Placeholder text for the control's empty state.
requiredbooleanfalseMarks the control as required.
valuestring''Initial value of the control, synchronized with the hidden form input.
Inherited from Hwc
AttributeTypeDefaultDescription
i18nstring''Per-instance text overrides as key: text pairs, merged over the global z-i18n script and the built-in defaults.
floatingstring''Floating UI placement options (for example offset and shiftPadding) parsed as key: value pairs.
force-prevent-rerenderbooleanfalseSkips re-rendering after the first render; an existing data-host-inner child is adopted as the rendered DOM.
templatestring''Selector or id of an external element or <template> whose inner content is cloned in place of an inline template[data-fn="template"] child.
Inherited from Base
AttributeTypeDefaultDescription
clsstring''Adds classes to named parts as key: classes pairs; a plain string targets the default part.
stlstring''Adds inline styles to named parts as key: styles pairs; a plain string targets the default part.

Custom Styling (cls / stl)

Default cls target:container · defaultstl target:container

KeyDefault classclsstlDescription
button—yesnoFallback class/style key used for the meridiem button when meridiem-button is unset.
containerz-input-timeyesyesThe field container (default z-input-time); the default cls/stl target.
hour-input—yesnoThe hour field.
inputz-inputyesnoShared input styling class (default z-input).
meridiem-buttonz-input-fakeyesnoAM/PM toggle in 12h mode (default z-input-fake).
minute-input—yesnoThe minute field.
separator—yesyesThe colon separator between fields.

CSS Variables

VariableDefaultScopeDescription
--z-input-time-column-gap0.25rem.z-input-timeGap between the hour, separator, minute, and meridiem segments.
--z-input-time-input-width3.5rem.z-input-timeWidth of each time segment.

i18n Keys

KeyDefaultPlaceholdersDescription
amAM—AM toggle text.
hour-labelHour—Accessible label of the hour field.
hour-placeholderHH—Placeholder of the hour field.
invalid-timeInvalid time format—Error message for out-of-range or malformed times.
meridiem-labelAM/PM—Accessible label of the AM/PM toggle.
minute-labelMinute—Accessible label of the minute field.
minute-placeholderMM—Placeholder of the minute field.
pmPM—PM toggle text.
time-labelTime—Accessible label of the time field group.

Events

EventDetailFlagsDescription
z-input-time:input · from InputMixin{ value: string | string[] }bubblesFires when the time changes; detail.value carries the HH:MM string.

Data Hooks

AttributeValuesApplies toRoleDescription
data-clock—descendantmarkerSet to the clock mode (12h/24h).
data-disabled—descendantmarkerSet while the control is disabled.
data-field—descendantmarkerMarks the hour/minute fields.
data-host-inner · from Hwc—descendantconfigMarks the rendered inner wrapper so force-prevent-rerender can adopt server-rendered DOM without re-rendering.
data-key—descendantmarkerMarks keyboard-interactive segments.
data-meridiem—descendantmarkerSet to the current meridiem (am/pm).
data-reactive · from Hwc—descendantconfigOpts the marked child (config script, data source, icons, or template) into live re-parsing when its DOM mutates.
data-valid—descendantmarkerReflects whether the current time is valid.

Child Content

script[data-fn="config"][type="application/json"]

JSON configuration script parsed by the base class (i18n, cls, stl, floating).

AttributeRequiredTypeDescription
data-fnyesconfigMarks the script as configuration (value: config).
data-reactivenobooleanRe-parses the configuration when the script mutates.

select[data-fn="data-source"]

Hidden select parsed into grouped option data by the base class.

AttributeRequiredTypeDescription
data-fnyesdata-sourceMarks the select as the data source (value: data-source).
data-reactivenobooleanRe-parses the options when the select mutates.

optgroup · repeatable

Groups options under a label.

AttributeRequiredTypeDescription
labelyesstringGroup header text; also the default group key.
disablednobooleanDisables every option in the group.
data-keynostringOverrides the group key used in the parsed data.
data-keywordsnocomma-separated stringComma-separated keywords stored with the group's data.

option · repeatable

One option entry within the group.

AttributeRequiredTypeDescription
valuenostringValue carried by this option in the parsed data.
disablednobooleanMakes the option non-selectable.
selectednobooleanMarks the option as initially selected.
data-keywordsnocomma-separated stringExtra search terms, comma-separated; searched alongside the label and value.

option · repeatable

One ungrouped option entry.

AttributeRequiredTypeDescription
valuenostringValue carried by this option in the parsed data.
disablednobooleanMakes the option non-selectable.
selectednobooleanMarks the option as initially selected.
data-keywordsnocomma-separated stringExtra search terms, comma-separated.

template[data-fn="icons"]

Instance-level icon repository.

AttributeRequiredTypeDescription
data-fnyesiconsMarks the template as an icon source (value: icons).
data-reactivenobooleanRe-parses the icons when the template mutates.

* · repeatable

One icon element.

AttributeRequiredTypeDescription
data-keyyesstringIcon key referenced by $icons.

template[data-fn="template"]

Deferred content template mounted by the base class.

AttributeRequiredTypeDescription
data-fnyestemplateMarks the template for deferred mounting (value: template).
data-reactivenobooleanRe-parses the template when it mutates.

CSS Classes

ClassRoleApplies toDescription
.z-input-fakestate.z-input-timeInput-styled affordance used for the meridiem toggle.
.z-input-timerootz-input-timeRoot class of the time field.

Keyboard

KeysActionWhen
ArrowUp ArrowDownIncrements/decrements the focused hour or minute (wrapping).—
PageUp PageDownLarger steps: ±1 hour, ±15 minutes.—
ArrowUp ArrowDown SpaceToggles AM/PM.The meridiem button is focused (12h clock).

Accessibility

  • Each segment is labeled; the group carries the time-label name.
  • The value submits as HH:MM through the hidden form input.