Backpack UI
Components
Forms
Phone

Phone input

The Phone input is a wrapper around Select and Text inputs.


+213
React

_10
<FormPhoneInput name={'phone'} placeholder={'phone'} />

Track value changes

To track value changes on this input, please use onValueChange property.

React

_10
<FormPhoneInput name={'phone'} placeholder={'phone'} onValueChange={(newVal) => handleValueChange(newVal)} />

+213


Override country list

Country list can be overridden and provided to the component.

countries-example.json

_14
[
_14
{
_14
"name": "Algérie Test",
_14
"callingCode": "213",
_14
"isoCountryCode": "DZ",
_14
"imgSrc": ""
_14
},
_14
{
_14
"name": "Argentina Test",
_14
"callingCode": "54",
_14
"isoCountryCode": "AR",
_14
"imgSrc": ""
_14
}
_14
]

React

_10
import countries from './countries-example.json';
_10
_10
<FormPhoneInput name={'phone'} placeholder={'phone'} countries={countries} />

+213