OTP / PIN Input

Six-digit one-time passcode entry with auto-focus, auto-advance, backspace navigation, and paste support. For PINs, enable masking to show bullets.

Preview

0/6
6-digit OTP
0/6
6-digit PIN (masked)
0/4
4-digit PIN

Error state

Code expired. Request a new one.

Disabled

0/6

Props

PropTypeDefaultDescription
lengthnumber6Number of input boxes.
onComplete(value: string) => voidCalled when all digits are filled.
type"numeric" | "alphanumeric""numeric"Input mode and validation.
maskbooleanfalseIf true, shows bullets instead of digits.
disabledbooleanfalseDisables all inputs.
errorstringError message shown below input.
autoFocusbooleanfalseFocus first input on mount.

Behavior notes

  • Auto-advances focus to next box after digit entry.
  • Backspace moves focus to previous box if current is empty.
  • Paste support: pasting '123456' fills all boxes automatically.
  • autoComplete='one-time-code' triggers SMS autofill on iOS/Android.