ArtificialSenseDocs

Docs / Components

SenseInputOtpComponent

Multi-cell one-time password input from @artificialsenselabs/ui with keyboard navigation, paste support, and forms integration.

Live demo: run nx serve showcase and open /components/input-otp (port 4202).

Overview

Category: Form controls. Selector: sense-input-otp. Import: import { SenseInputOtpComponent } from '@artificialsenselabs/ui';

<sense-input-otp
  ariaLabel="Verification code"
  [length]="6"
  [(ngModel)]="code"
  (otpChange)="onCodeChange($event)"
/>

Inputs & outputs

MemberTypeDefaultDescription
lengthnumber6Number of single-character cells.
size'sm' | 'md' | 'lg''md'Visual density preset.
integerOnlybooleantrueRestricts input and paste to digits.
ariaLabelstring | nullnullAccessible name for the OTP group.
otpChangeSenseInputOtpChangeEventโ€”Emits combined value on typing or paste.

Accessibility

  • Host uses role="group" with per-digit aria-label values.
  • Arrow keys move between cells; Backspace moves to the previous cell when empty.
  • Paste distributes characters across cells up to length.
  • Implements ControlValueAccessor for Angular forms integration.