

Every state


default


focus


filled


verifying


verified


error


disabled
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| id | string | "sms-code" | Input id; the label, description and message point at it. |
| name | string | "code" | Form field name. |
| label | string | "Code from the text message" | Visible label. |
| description | string | – | Help text under the field. |
| length | number | 6 | Number of digits. |
| placeholder | string | "000000" | Placeholder digits. |
| defaultValue | string | – | Starting digits; non-digits are dropped. |
| verifyLabel | string | "Verify" | Text on the joined button. |
| verify | (code: string) => Promise<boolean> | – | Checks the code on the button or Enter; the default accepts 135790 after a short delay. |
| onComplete | (code: string) => void | – | Fires once the field holds a full code. |
| status | "idle" | "verifying" | "verified" | "error" | – | Starting state, e.g. a result the server already has. |
| errorMessage | string | "That code is wrong or has expired. Try again or ask for a new one." | Message for a wrong code. |
| disabled | boolean | – | Disables the field and button. |
| className | string | – | Extra classes on the outer Field. |
More code inputs
All 4otp-input-03 is in UI ProGet UI Pro, €199


