Container directive for OTP/PIN input with auto-advance
CngxOtpInput
DirectivePrimaryv0.1.0WCAG AA
projects/forms/input/otp-input.directive.ts
Import#
import { CngxOtpInput } from '@cngx/forms/input'
Description#
Container directive for OTP/PIN input with auto-advance.
Renders no inputs - the consumer provides <input [cngxOtpSlot]="i" /> elements
inside the container.
<div cngxOtpInput [length]="6" #otp="cngxOtpInput" (completed)="verify($event)">
@for (i of otp.indices(); track i) {
<input [cngxOtpSlot]="i" />
}
</div>