Input OTP
One-time password input with emerald/dark aesthetic
Preview
Installation
npx shadcn@latest add @glitchcn/input-otpUsage
import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/components/ui/input-otp"
// 6-digit OTP
<InputOTP maxLength={6}>
<InputOTPGroup>
{[0, 1, 2, 3, 4, 5].map((i) => (
<InputOTPSlot key={i} index={i} />
))}
</InputOTPGroup>
</InputOTP>
// 4-digit PIN
<InputOTP maxLength={4}>
<InputOTPGroup>
{[0, 1, 2, 3].map((i) => (
<InputOTPSlot key={i} index={i} />
))}
</InputOTPGroup>
</InputOTP>