Content
- Write the error as what happened, in one short sentence: “That code has expired.”
- Clear the error as soon as the code changes, because the field keeps it until you do.
Takes a six-digit code in separate boxes that behave like one field, including paste.
Type a code, step back with Backspace, move with the arrow keys, or paste six digits.
<WildVerificationCodeInput
v-model="code"
/>Six boxes that behave as one field.
<WildVerificationCodeInput v-model="code" />Each box is its own input, named “Digit 1 of 6” and so on, inside one group. The error message is announced when it appears.
| Key | What it does |
|---|---|
| A digit | Fills the box and moves to the next one. |
| Backspace | Clears the box. On an empty box, clears the one before and moves there. |
| ← / → | Moves to the previous or next box. |
| Paste | Fills from the first box, then focuses the next empty one. |
| Tab | Moves through the boxes, then out. |
| Prop | Type | Default | Description |
|---|---|---|---|
| v-model | string | — | The code, up to six digits. |
| error | string | — | Message under the boxes. Turns all six red. |
| disabled | boolean | false | Blocks all six boxes. |
| Token | Value | Where it lands |
|---|---|---|
| --radius-lg | 8px | Each box, the same as every field. |
| --global-blue-1000 | #1877F2 | The 2px edge of the box with the caret, and the caret itself. 4.23:1; the cyan was 2.53:1. |
| --global-neutral-grey-800 | #ADACB0 | Any box on hover. |
| --global-neutral-grey-600 | #DCDCDE | Every box at rest, empty or filled, 1px. |
| --color-error | #E12121 | The 2px edge of all six boxes, and the message. |
| --global-neutral-grey-300 | #F1F1F1 | The ground when disabled. |
| --font-size-2xl | 20px | The digits. |
| --font-weight-medium | 475 | The digits. |