About
A one-time-password input made of individual boxed digit slots, used for verification codes in sign-in and two-factor flows.
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
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp";
export default function Demo() {
return (
<InputOTP
aria-label="Verification code"
maxLength={6}
containerClassName="w-full max-w-sm"
>
<InputOTPGroup className="min-w-0 flex-1">
<InputOTPSlot index={0} className="min-w-0 flex-1" />
<InputOTPSlot index={1} className="min-w-0 flex-1" />
<InputOTPSlot index={2} className="min-w-0 flex-1" />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup className="min-w-0 flex-1">
<InputOTPSlot index={3} className="min-w-0 flex-1" />
<InputOTPSlot index={4} className="min-w-0 flex-1" />
<InputOTPSlot index={5} className="min-w-0 flex-1" />
</InputOTPGroup>
</InputOTP>
);
}











