ortaui

Input OTP

One-time code input on Base UI's OTPField. Slots are separate tiles; the focused one takes the page fill.

Installation#

npx shadcn add @ortaui/input-otp

Examples#

Six digits#

Four digits, disabled and invalid#

API reference#

PropTypeDefaultDescription
surface"default" | "raised"autoLook on a panel. Unset: raised (page fill + border) inside any [data-surface] container. "raised" forces it anywhere; "default" keeps the muted fill even inside a surface.
lengthnumber-Number of slots. Render exactly that many InputOTPSlot.
value / defaultValuestring-Controlled or uncontrolled value.
onValueComplete(value) => void-Called when every slot is filled.
validationType"numeric" | "alpha" | "alphanumeric" | "none"-Allowed characters.