OTP
Each example below is a real component instance — flip the theme toggle to see how it adapts.
Default#
Loading…
Four Digit#
Loading…
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| length | number | undefined | 6 | Number of digit slots. Defaults to 6. |
| onComplete | ((code: string) => void) | undefined | — | Called with the assembled string when every slot has a value. |
| onChange | ((value: string) => void) | undefined | — | Called with the partial string on every change. |
| defaultValue | string | undefined | | Initial value (string of digits). |
| ariaLabel | string | undefined | Code | Aria label applied to each individual slot, suffixed with " {n} of {N}". |
| className | string | undefined | — | |
| disabled | boolean | undefined | — |