One-time code cells for wallet connect / verify. Paste fills from any cell; width reserved on first paint. Interior otp-input contract, CSS-only.
Anatomy
┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │1 │ │2 │ │3 │ · │4 │ │5 │ │6 │ ← groupEvery gap └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ hint / error (shared reserved line)
Props
| Prop | Type | Default | Notes | |
|---|---|---|---|---|
length | number | 6 | Cell count. | |
mode | "numeric" | "alphanumeric"` | "numeric" | Allowed chars + inputMode. |
defaultValue | string | "" | Seed, filtered + truncated. | |
onChange | (value: string) => void | — | Every accepted edit. | |
onComplete | (value: string) => void | — | When every cell is filled. | |
error | boolean | false | aria-invalid on cells. | |
errorMessage / hint | string | — | Shared status line (no jump). | |
label | string | "Verification code" | Group + per-cell names. | |
groupEvery | number | 3 | Visual gap every N cells. | |
disabled / autoFocus | boolean | false | — | |
className | string | — | cn-merged. |
Motion
- · Border color 150ms. No
motionpackage. Reduced-motion: global reset.
A11y
- ·
role="group"+ per-cell labels;one-time-codeautocomplete on first cell - · Arrow / Backspace navigation; paste supported
- · Status via polite live region