Input OTP

A segmented one-time-password field with per-cell focus.

Install

npx shadcn add @clearly/input-otp

Preview

Live Input OTP component — see usage below.

Usage

import { InputOTP } from "@/components/ui/input-otp"

<InputOTP />

Every Clearly component also accepts glass (subtle·medium·strong), specular and className.

Props

PropTypeDefaultDescription
maxLengthnumberTotal number of OTP characters.
valuestringControlled code value.
onChange(value: string) => voidChange callback.
inputMode"numeric" | "text""numeric"Keyboard mode.
containerClassNamestringClass applied to the container div.