Hi all! We are excited to announce the beta launch of the Phone Number Input component!
With PhoneNumberInput, you can now have inputs that automatically format phone numbers as you type. The input has a country dropdown selector, where the user can choose which country they want their phone number to be from. The default country that the dropdown selects will be based on the user’s IP address.
Some things to note about this new component:
- Currently, the input only formats international phone numbers correctly. If there is enough feature request for us to implement a domestic (local) formatting option, we will consider adding this in as well.
- There are currently multiple ways to access formatting options from the component:
.value: this is the raw, unformatted value of the input
.formattedValue: this maps 1-1 with the formatted value that the input displays
.parsedValue: this offers more advanced formatting options:
domesticNumber: the domestic/local formatting of the phone number
internationalNumber: the international formatting of the phone number
selectedCountryCode: the country that is selected in the input dropdown (this is the country that the formatting is based on)
uri: the international URI for the phone number
valid: whether the phone number is valid or not, based on the
- Example usage:
Please leave a comment in this thread or DM me if you’d like me to turn this feature on for your org! (Note: available now on cloud, coming to on premise soon). You are also welcome to leave a comment in this thread or DM me with any feedback you have.