The PhoneInput component allows users to enter their phone number.
View source codestring
The calling code for the phone number (e.g. +33)
Country[]
The list of countries to display in the country dropdown of the phone input
string
The selected country for the phone number (e.g. FR)
(value: string, country: string, callingCode: string) => string
Function which formats the phone number (for example with spaces or removing the leading zero)
(newValue: string) => void
Handler that is called when the value changes.
(selectedCountry: Country) => void
Handler that is called when the country changes.
string
The current value (controlled).
string
className for the element
"content" | "parent"
Whether the PhoneInput should fit its parent or content
Default: contentstring
The id of the PhoneInput
boolean
Whether the PhoneInput is disabled.
boolean
Whether the PhoneInput is invalid.
string
The name of the PhoneInput, used when submitting an HTML form
FocusEventHandler<HTMLInputElement>
Handler that is called when the element loses focus.
FocusEventHandler<HTMLInputElement>
Handler that is called when the element receives focus.
KeyboardEventHandler<HTMLInputElement>
Handler that is called when a key is pressed.
string
Temporary text that occupies the PhoneInput when it is empty.
Ref<HTMLInputElement>