Input OTP

A one-time password input with individual character slots. Supports auto-advancing focus, paste handling, and flexible grouping with separators.

6-Digit OTP

<InputOTP maxLength={6}>
  <InputOTPGroup>
    <InputOTPSlot index={0} />
    <InputOTPSlot index={1} />
    <InputOTPSlot index={2} />
  </InputOTPGroup>
  <InputOTPSeparator />
  <InputOTPGroup>
    <InputOTPSlot index={3} />
    <InputOTPSlot index={4} />
    <InputOTPSlot index={5} />
  </InputOTPGroup>
</InputOTP>

API Reference

PropTypeDefaultDescription
maxLengthnumberThe total number of OTP slots.
valuestringThe controlled value of the OTP input.
onChange(value: string) => voidCallback fired when the OTP value changes.