v0.1 public beta early access on GitHub
Home / Components / otp-input

OTP InputAndroid

One-time-code input with N cells, auto-advance, backspace navigation, paste support, animated focus ring and per-cell haptics

$ npx lumioui add otp-input
import { OtpInput } from "@/components/ui/otp-input/otp-input";
OTP Inputotp-input.tsx
otp-input/otp-input.tsx open

Live preview — the real component, driven by the props below.

Props9
value? string Controlled code value (digits/chars entered so far).
onChange? (value: string) => void
onComplete? (code: string) => void Fired once when the code reaches `length` characters.
length? number Number of cells. Default 6.
secure? boolean Mask cells like a password field. Default false.
status? OtpStatus Validation state — error shakes the row, success tints the ring. Default "default".
errorMessage? string Error message announced to screen readers when status is "error".
disabled? boolean Disabled state — dims the row and blocks focus. Default false.
className? string Extra classes for the outer wrapper.
OTP Inputotp-input.tsx
otp-input/otp-input.tsx open

One-time-code input with N cells, auto-advance, backspace navigation, paste support, animated focus ring and per-cell haptics