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
Exports
| Export | Notes |
|---|---|
InputOTP | Root; maxLength (code length), value/onChange, pattern (default digits), autoFocus |
InputOTPGroup | Slot cluster |
InputOTPSlot | One character cell — index required; shows caret/caret-blink when active |
InputOTPSeparator | The 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.