Forms / Phone field

Forms

Phone field

A dial code and a number in one box: one border, one focus ring.

import { EcoPhoneField } from "vue-ecosphere"

Phone

Open the dial code with a click or ArrowDown; Escape closes it.

We only use it for delivery alerts.

Value: +91 98765 43210

Empty

Not a number

Type the missing digits to clear the error.

A UK mobile has ten digits after the dial code.

Fixed dial code

Without codes the dial code is text: nothing to tab to or click, and it is read with the number.

+91

Numbers in India only.

Disabled

+91

Verified numbers are changed from account settings.

API

NameTypeDefaultDescription
v-modelstring""The number, kept as typed.
v-model:codestring"+1"The dial code. Default it from the account's country.
codes{ code: string; label?: string }[][]Dial codes in the menu. Empty: the code is plain text, not a button, and describes the number.
errorstring—Turns the whole phonefield; say what a valid number looks like there.
label / required / hint / invalid / first / disabled / placeholder / id——Field props.
numberLabelstring"Phone number"Accessible name of the number when there is no label.