PhoneInput
Enhanced TextInput using JS wrapper of Google's Android phone number lib.
Browser autocompletion is slightly bugged in Chrome as for now.
Make sure to put a <PhoneInput /> into a <form/> otherwise web-browser's "autocomplete"
feature may not be working: a user will be selecting his phone number from the list but nothing will be happening.
Props
countries
Array<{}>
[]
countriesLoading
Bool
false
defaultCountryCode
String
"US"
defaultPhoneNumber
String
[Empty string]
fetchCountries
Func
required
isSearchable
Bool
false
maxLength
Number
21
minLength
Number
4
name
String
[Empty string]
onBlur
Func
onChange
Func
required
onCountryChange
Func
placeholder
String
"Enter a phone number"
userLocationLoading
Bool
false
validate
Bool
true
Note: defaultPhoneNumber and defaultCountryCode props are not required, since all the logic is also handled locally.
Examples
Default PhoneInput
PhoneInput with defaultCountryCode and defaultPhoneNumber
PhoneInput without validation