OTP Input

React OTP input component for one-time password and verification code entry — split digit cells, grouped layouts, error states, and autofill

import { OTPInput } from "@plexui/ui/components/OTPInput";

Examples

Overview

Filled state

Grouped (3+3)

With error

Disabled

Reference

PropTypeDefaultDescription
lengthnumber6Number of digit cells
valuestringControlled value
onChange(value: string) => voidCalled when value changes
onComplete(value: string) => voidCalled when all digits filled
groupingnumber[]Grouping pattern with extra gap (e.g. [3,3])
invalidbooleanfalseInvalid visual state
errorMessagestringError message below the input
disabledbooleanfalseDisable all cells
autoFocusbooleanfalseAuto-focus first cell on mount