About
A one-time-code input with a monospace box per digit that supports typing, backspace navigation, arrow-key movement, paste distribution and OS autofill.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Input OTP to your project and fits it to your theme.
Code
How Input OTP is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import { InputOtp } from "@/components/ui/input-otp";
export default function InputOtpVariantsDemo() {
return (
<div className="flex flex-col items-center gap-6">
<InputOtp length={4} aria-label="PIN" />
<InputOtp groupEvery={3} aria-label="Verification code" />
<InputOtp isInvalid aria-label="Verification code" />
<InputOtp isDisabled defaultValue="1234" aria-label="Verification code" />
</div>
);
}








