OTP Input
A row of individual digit boxes for one-time codes. Auto-advances on entry, steps back on Backspace, handles paste, and navigates with arrow keys. Best used inside a bottom Drawer.
Installation
npx stepwise-ui add otp-input
Default
Security code
Set type="alphanumeric" to accept letters and digits (auto-uppercased) - for security or redemption codes like 7F3K9Q.
Lengths
Any length via length - a 4-digit PIN, an 8-character code, whatever you need.
Error state
Props
PropTypeDescription
lengthnumberNumber of boxes. Default 6 - any length.
type"numeric" | "alphanumeric"Digits only (default), or letters + digits.
valuestringControlled value.
onChange(value: string) => voidFires with the full digit string on every change.
errorbooleanRed ring on all boxes.
disabledbooleanDisables all inputs.