GithubX

Input OTP

Accessible one-time password input.

## installation

pnpm dlx shadcn@latest add https://ascii.cnlibs.com/r/input-otp.json

## usage

import { InputOTP, InputOTPSlot } from "@/components/ui/input-otp";
<InputOTP length={6}>
  {Array.from({ length: 6 }, (_, i) => (
    <InputOTPSlot key={i} index={i} />
  ))}
</InputOTP>

## with label

## 4 digits

length sets the number of slots — render one InputOTPSlot per index.

## controlled

0/6 digits

## disabled