Components › Forms

Input OTP

One-time code entry with auto-advance, paste support and grouped cells.

Installation

npx plankui@latest add input-otp

Usage

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

<InputOTP length={6} groupSize={3} onComplete={verify} />

API reference

PropTypeDefaultDescription
lengthnumber6Number of cells.
groupSizenumberInsert a gap after this many cells.
value / onChangestring / (v) => voidControlled value.
onComplete(code: string) => voidCalled when every cell is filled.
invalidbooleanfalseError style.

View the source on GitHub