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
| Prop | Type | Default | Description |
|---|---|---|---|
maxLength | number | — | The total number of OTP slots. |
value | string | — | The controlled value of the OTP input. |
onChange | (value: string) => void | — | Callback fired when the OTP value changes. |