componentsSource CodeRadix UI
/components/ui/otp-field.tsx
/components/ui/otp-field.tsx
OTP Field
A group of single-character text inputs to handle one-time password verification
Installation
Usage
Imports
import { OTPField, OTPHiddenInput, OTPInput } from "@/components/ui/otp-field"Code
<OTPField>
<OTPInput />
<OTPInput />
<OTPInput />
{/* HiddenInput is required for the form to have data associated with the field */}
<OTPHiddenInput />
</OTPField>Examples
Size
Type - Password
Validation Type
Disabled
Form
Auto Submit Form
Props
<OTPField>
| Name | Default | Values |
|---|---|---|
| size | 40 | 283236404456 |
| External Reference | - | - |
<OTPInput>
| Name | Default | Values |
|---|---|---|
| External Reference | - | - |
<OTPHiddenInput>
| Name | Default | Values |
|---|---|---|
| External Reference | - | - |