OTPInput

A one-time password input composed of individual single-character cells. Supports keyboard navigation, auto-advance, and paste.

Installation

npx dafink-ui add otp-input

Demo

Enter the 6-digit code from your email.

This code has expired.

Props

NameTypeDefaultDescription
lengthnumber6Number of cells.
valuestring''Controlled value. Each character maps to a cell by index.
onChange(value: string) => void-Called with the full updated string on any change.
labelstring-Visible label above the cells.
errorstring-Error message; all cells enter the error state.
hintstring-Helper text shown below the cells.
disabledbooleanfalseDisables all cells.