edbnedbn/ui
ComponentsMapsPDF
GitHub stars
Explorer
Get Started
Components

Input OTP

Premium solid one-time password input with paste, validation, and separators.

Componentsdocsinput-otp.rodz.dev/

Installation

npx shadcn@latest add https://ui.edbn.me/api/analytics/registry/input-otp.json

Manual

API Reference

InputOTP

One-time password input built on the input-otp library. Manages focus and validation.

maxLengthnumberRequired

Number of OTP digits

valuestring

Controlled input value

onChangefunction

Called when value changes

onCompletefunction

Called when all slots filled

patternstring (regex)

Input validation pattern

disabledboolean
=false

Disable input

autoFocusboolean
=false

Auto-focus on mount

classNamestring

CSS class name

InputOTPGroup

Groups adjacent OTP slots visually.

classNamestring

CSS class name

InputOTPSlot

A single OTP character slot.

indexnumberRequired

Slot index (0-based)

classNamestring

CSS class name

InputOTPSeparator

A visual separator between OTP groups (e.g., a dash).

classNamestring

CSS class name