The PhoneInput component allows users to enter their phone number.
View source codestringThe calling code for the phone number (e.g. +33)
Country[]The list of countries to display in the country dropdown of the phone input
stringThe selected country for the phone number (e.g. FR)
(value: string, country: string, callingCode: string) => stringFunction which formats the phone number (for example with spaces or removing the leading zero)
(newValue: string) => voidHandler that is called when the value changes.
(selectedCountry: Country) => voidHandler that is called when the country changes.
stringThe current value (controlled).
stringclassName for the element
"content" | "parent"Whether the PhoneInput should fit its parent or content
Default: contentstringThe id of the PhoneInput
booleanWhether the PhoneInput is disabled.
booleanWhether the PhoneInput is invalid.
stringThe 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.
stringTemporary text that occupies the PhoneInput when it is empty.
Ref<HTMLInputElement>