Input OTP

One cell per character, with a drawn caret in the active one.

pulls ininput-otplucide-react@afterglow/theme

Installation

npx shadcn@latest add @afterglow/input-otp

Composition

Component structure.

InputOTP
├── InputOTPGroup
│   └── InputOTPSlot
└── InputOTPSeparator

API Reference

InputOTP

PropTypeDefault
containerClassNamestring-

InputOTPSlot

One character cell. index is which position of the code it draws, so a group of four is four slots numbered 0 to 3.

PropTypeDefault
indexnumber-

Everything else is input-otp's API, documented there.