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-inputDemo
Enter the 6-digit code from your email.
This code has expired.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| length | number | 6 | Number of cells. |
| value | string | '' | Controlled value. Each character maps to a cell by index. |
| onChange | (value: string) => void | - | Called with the full updated string on any change. |
| label | string | - | Visible label above the cells. |
| error | string | - | Error message; all cells enter the error state. |
| hint | string | - | Helper text shown below the cells. |
| disabled | boolean | false | Disables all cells. |