A
Auralix UI

Input OTP

Accessible one-time password input.

Preview

Installation

bash
npx auralix-ui add input-otp

Usage

OTP Input

tsx
import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/components/ui/InputOTP";

<InputOTP maxLength={6}>
  <InputOTPGroup>
    <InputOTPSlot index={0} />
    <InputOTPSlot index={1} />
    <InputOTPSlot index={2} />
  </InputOTPGroup>
</InputOTP>

Props

NameTypeDefaultDescription
maxLengthnumber6Number of characters.

Variants

Numeric (6-digit)
Short (4-digit)
With Separator
-