Input OTP

Segmented one-time-code entry.

shadcn/ui · new-york-v4 · synced Aug 28, 2026shadcn/uinew-york-v4 · synced Aug 28, 2026

Installation

import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from "@aspyn-io/kit";

Six-digit verification

Pattern

Restrict what can be typed with the pattern prop. input-otp ships REGEXP_ONLY_DIGITS, REGEXP_ONLY_CHARS, and REGEXP_ONLY_DIGITS_AND_CHARS.

Controlled

Drive the value with value + onChange to read digits as they are typed.

Enter your one-time password.

Disabled

Notes

  • Controlled: value + onChange; fires onComplete when all slots fill.
  • Paste, arrow keys, and screen-reader announcements handled by input-otp.