Phone Input

Ready to use phone input component with country code dropdown, with validation and formatting. The component extend the <BaseInput> component, so you can use all the props and events of the base component.

This component uses libphonenumber-js and country-codes-list to detect and validate the phone input value.
Show code

Country Input

The component provides a country dropdown to select the country code, you can use the country prop to set the default country, otherwise it will be detected from the user's input. You can use the v-model:country notation to get the selected/detected country code.

Show code

By default, the input value will be formatted in the international format, you can change this behavior with the format prop to change it to national.

Show code

Validation

The component provides a @validation event to indicate if the input value is valid or not

Show code

Disabled State

Show code

Input Size

Show code

Input Shapes

Show code
v-model
The value of the input.
Show example
rounded
The radius of the input.
Show example
country
Default country code, in ISO 3166-1 alpha-2 format.
Show example
format
When set to `national`, the country indicator is omitted.
Show example
height
The max height of the dropdown.
Show example
item-height
The height of each dropdown item.
Show example
icon
Default icon used when no country is selected/detected.
Show example
size
The size of the input.
Show example
error
An error message or boolean value indicating whether the input is in an error state.
Show example
disabled
Show example
@validation
Show example
@update:country
Show example
#country-label
Show example
#country-placeholder
Show example
#country-item
Show example
#action
Show example
validation
Show example
currentCountry
Show example
possibleCountries
Show example
filter
Show example
filterRef
Show example
dropdownRef
Show example
inputRef
Show example