Skip to main content
cngx-src documentation

CngxOtpSlot

DirectivePrimaryv0.1.0WCAG AA

projects/forms/input/otp-input.directive.ts

Import#

import { CngxOtpSlot } from '@cngx/forms/input'

Description#

Marks a single input slot within a [cngxOtpInput] container.

@for (i of otp.indices(); track i) {
  <input [cngxOtpSlot]="i" />
}

https://cngxjs.github.io/cngx/examples/#/forms/input/otp/4-digit-pin https://cngxjs.github.io/cngx/examples/#/forms/input/otp/6-digit-otp

Metadata#

Host#

Index#

Inputs#

index#number
input()Required

The zero-based index of this slot.

default { alias: 'cngxOtpSlot' }

HostBindings#

BindingExpression
[attr.type]inputAttrType()
[attr.maxlength]1
[attr.autocomplete]index() === 0 ? "one-time-code" : "off"
[attr.inputmode]inputMode()
[attr.aria-label]slotLabel()

HostListeners#

EventHandler
(input)input()
(keydown)keydown()
(paste)paste()
(focus)focus()