

Every state


default


focus


partial


filled


error


disabled
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string | "authenticator-code" | Id of the real input; the label, description and error point at it. |
| name | string | "code" | Form field name. |
| label | string | "Authenticator code" | Visible label. |
| description | string | – | Help text under the code. |
| groups | number[] | [3, 3] | Digits per joined strip; the total is the code length. |
| defaultValue | string | – | Starting digits; non-digits are dropped. |
| error | string | – | Error message (e.g. a wrong code); marks both strips and clears once the code is edited. |
| disabled | boolean | – | Disables the field. |
| autoFocus | boolean | – | Focuses the code on mount. |
| onComplete | (code: string) => void | – | Fires once every segment is filled, by typing, paste or autofill. |
| className | string | – | Extra classes on the outer Field. |
More code inputs
All 4otp-input-01 is in UI ProGet UI Pro, €199


