Atelier UI

Search components…

Search components…

OTP Input

One-time code input with paste support, grouping, masking and keyboard navigation.

Edit in sandbox

Copy a prompt for your AI coding tool with the source, dependencies and usage

Props

OtpInputProps

Also accepts all props of Omit<React.ComponentProps<"div">, "onChange" | "defaultValue">

PropTypeDefaultDescription
lengthnumber6—
valuestring——
defaultValuestring""—
onChange(value: string) => void——
onComplete(value: string) => void—Called once every slot is filled
groupSizenumber3Insert a separator after every N slots, 0 for none
maskbooleanfalseShow dots instead of the digits
alphanumericbooleanfalseAccept letters as well as digits
invalidbooleanfalse—
disabledbooleanfalse—

Install

$ npx shadcn@latest add https://chromotion.dev/r/otp-input.json

The CLI installs the base component; your customizations live in the code generated on the Customize tab.

More like this