components

OTP Field

A group of single-character text inputs to handle one-time password verification

Source CodeRadix UI

Installation

pnpm dlx radianui@latest add otp-field

Usage

Imports

/components/ui/otp-field.tsx
import { OTPField, OTPHiddenInput, OTPInput } from "@/components/ui/otp-field"

Code

/components/ui/otp-field.tsx
<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

Please enter the OTP sent to your phone.

Auto Submit Form

Please enter the OTP sent to your phone.

Props

<OTPField>
NameDefaultValues
size40283236404456
External Reference--
<OTPInput>
NameDefaultValues
External Reference--
<OTPHiddenInput>
NameDefaultValues
External Reference--