Input OTP

One-time-code input with slots, over input-otp.

InputOTP is a verification-code input: keyboard- and paste-driven, styled slot groups, screen-reader friendly.

Installation

import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from "@iammikz/srui";

Usage

Type or paste a code

Exports

ExportNotes
InputOTPRoot; maxLength (code length), value/onChange, pattern (default digits), autoFocus
InputOTPGroupSlot cluster
InputOTPSlotOne character cell — index required; shows caret/caret-blink when active
InputOTPSeparatorThe dash between groups

Accessibility

The input itself is screen-reader-only; slots announce as labelled cells and the caret blink is disabled under prefers-reduced-motion.