Forms
OTP field
A one-time code, one box per digit, in four, five or six digits.
import { EcoOtpField } from "vue-ecosphere"
Six digits
Typing advances, Backspace goes back, and pasting a code fills every box.
Verification code
We sent it to +91 98••• •••21.
Value: "428" · Completed: —
Four digits
PIN
Five, grouped
Access code
Wrong code
Always offer a way to send another.
Verification code
That code has expired. Send a new one.
API
| Name | Type | Default | Description |
|---|---|---|---|
v-model | string | "" | The digits entered so far. |
length | 4 | 5 | 6 | 6 | One box per digit, so the length is visible before typing. |
size | "md" | "sm" | "md" | Smaller boxes (otp--sm). |
groupAfter | number | — | Put an otp__sep after this many digits. |
error / invalid | string / boolean | — | The whole group turns is-invalid: a wrong code is wrong as a whole. |
label / required / hint / first / disabled | — | — | Field props. Say where the code went in the hint, masked. |
groupLabel | string | "Verification code" | Group name when there is no label. |
@complete | (code: string) => void | — | Every box is filled (typing or paste). |