inputshwcz-input-pin

PIN Input

Segmented one-character fields for verification codes, with auto-advance, paste distribution, and completion events.

Attributes

AttributeTypeDefaultDescription
autofocusbooleanfalseFocuses the first field on mount.
lengthnumber6Number of digit fields (default 6).
input-mode'numeric' | 'text''numeric'Virtual keyboard mode: numeric (default) or text.
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:wrapper · defaultstl target:wrapper

KeyDefault classclsstlDescription
descriptionsr-onlyyesyesGroup description (default sr-only).
host-inner—yesyesRendered root wrapper.
input—yesyesOne single-character field.
labelsr-onlyyesyesGroup label (default sr-only).
wrapperz-input-pinyesyesThe fields wrapper (default z-input-pin); the default cls/stl target.

CSS Variables

VariableDefaultScopeDescription
--z-input-pin-focus-ring-colorvar(--z-focus).z-input-pinFocus ring base color, mixed with transparency using --z-input-pin-focus-ring-color-o.
--z-input-pin-focus-ring-color-o100%.z-input-pinFocus ring opacity percentage used in the mix.
--z-input-pin-input-border-colorvar(--z-input).z-input-pin inputField border base color, mixed with transparency using --z-input-pin-input-border-color-o.
--z-input-pin-input-border-color-ovar(--z-input-o).z-input-pin inputField border opacity percentage used in the mix.
--z-input-pin-radiusvar(--z-form-input-radius).z-input-pinCorner radius of the fields.
--z-input-pin-separated-gap0.5rem.z-input-pin.z-input-pin-separatedGap between separated fields.
--z-input-pin-separated-input-shadowvar(--z-form-input-shadow).z-input-pin.z-input-pin-separatedBox shadow of each separated field.
--z-input-pin-shadowvar(--z-form-input-shadow).z-input-pinBox shadow of the joined field.

i18n Keys

KeyDefaultPlaceholdersDescription
completePIN entry complete—Announcement when all fields are filled.
descriptionEnter {length}-digit codelengthGroup description template with {length}.
field-filledField {n} fillednAnnouncement template when a field is filled, with {n}.
field-labelDigit {n} of {total}n, totalPer-field label template with {n} and {total}.
labelPIN Code—Accessible group label.
loadedPIN input ready—Announcement when the input is ready.

Events

EventDetailFlagsDescription
z-input-pin:change · from InputMixin{ value: string | string[] }bubblesFires when the committed code changes; detail.value carries the joined code.
z-input-pin:complete{ value: string }bubblesFires when every field is filled; detail.value carries the joined code.

Data Hooks

AttributeValuesApplies toRoleDescription
data-host-inner · from Hwc—descendantconfigMarks the rendered inner wrapper so force-prevent-rerender can adopt server-rendered DOM without re-rendering.
data-pin-input—descendantmarkerMarks each single-character field.
data-reactive · from Hwc—descendantconfigOpts the marked child (config script, data source, icons, or template) into live re-parsing when its DOM mutates.

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-pinrootz-input-pinRoot class of the fields wrapper.
.z-input-pin-separatedmodifier.z-input-pinSeparated presentation: individual boxed fields with a gap.

Keyboard

KeysActionWhen
ArrowLeft ArrowRightMove between fields.—
BackspaceClears the current field and steps back.—

Accessibility

PartARIADescription
description—Visually hidden group description.
host-inneraria-labelledby="${this.groupId}-label ${this.groupId}-desc" role="group"Group container: role="group" labeled by the label and description.
inputaria-label="dynamic"Single-character field with a per-digit aria-label.
label—Visually hidden group label.
wrapperrole="presentation"Fields wrapper: role="presentation".
  • The group is labeled and described; each field announces its digit position, and completion is announced politely.
  • Pasted codes are distributed across the fields.