Components/OTPInput

OTPInput

One-time password / PIN input with automatic focus advance, paste support, backspace navigation, and error state. Keyboard accessible.

import { OTPInput } from "@animui/ui"

Basic (6 digits)

Verification flow

Enter verification code

Sent to +1 (555) ***-4567

Waiting for input…

4-digit with error

Invalid code. Please try again.

Props

PropTypeDefaultDescription
lengthnumber6Number of digit inputs.
valuestring""Controlled value (concatenated digits).
onChange(value: string) => voidCalled on every digit change with the full value.
onComplete(value: string) => voidCalled when all digits are filled.
maskbooleanfalseMask input as password.
errorbooleanfalseShow error styling (red border).
disabledbooleanfalseDisable all inputs.
inputClassNamestringClasses applied to each digit input.
© 2026 Steal Shadow. MIT License.Report an issue