Installation
npx shadcn@latest add @iconiq/input-otpProps
OTP
Root wrapper around Base UI OTP Field that owns the shared value, completion state, and keyboard/paste behavior for every slot.
lengthnumberRequired
valuestringdefaultValuestringonValueChange(value: string, eventDetails) => voidonValueComplete(value: string, eventDetails) => voidvalidationType"numeric" | "alpha" | "alphanumeric" | "none"Default "numeric"
disabledbooleanDefault false
classNamestringcontainerClassNamestringBuilt on `OTPFieldPreview` from `@base-ui/react/otp-field`.
Prefer `OTPSlots` so slot count always matches `length`, or render one `OTPSlot` per character manually.
Supports `autoSubmit`, `mask`, `normalizeValue`, and `onValueInvalid` from the underlying Base UI root.
OTPSlots
Convenience layout that renders the correct number of slots from the parent `OTP` length, with an optional separator.
separatorAfternumberslotClassNamestringclassNamestringMust be rendered inside `OTP` so it can read the configured `length`.
Adds `aria-label` to every slot after the first one for screen reader context.
OTPSlot
Animated character cell with spring focus ring, pop-in digit motion, and a pulsing caret on the active empty slot.
classNamestringaria-labelstringThe real input is visually hidden but remains focusable for typing, paste, and mobile one-time-code autofill.
Slot order is determined by render order; the legacy `index` prop is accepted but ignored.
OTPGroup
Optional layout wrapper that groups slots with consistent spacing when you need multiple visual clusters.
classNamestringOTPSeparator
Accessible separator between OTP groups, rendered with the dotted divider used in the Iconiq preview.
classNamestringRegistry bundle
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: @base-ui/react/otp-field, motion.
This page documents the Base UI OTP Field preview install only.
The generated registry file is /r/input-otp.json.