Repository navigation
No breaking prop changes. PhoneInput's default list grows from 50 to ~244 countries, and the English names in the exported COUNTRIES now come from Intl.DisplayNames, so a few differ from before (e.g. TR is now "Türkiye") and wording can vary slightly between browsers. If you need a short, fixed list, pass countries.
Added
- PhoneInput: every ITU-T E.164 country (~244 entries). Flags are derived from the ISO code and English names from
Intl.DisplayNames, so neither is stored in the bundle. The original 50 keep their order at the top. (#95, @ujwalbajaj) - PhoneInput:
preferredCountriespins countries above a divider (style it withclassNames.preferredDivider). They are added even when missing fromcountries. (#95) - PhoneInput:
countriesandpreferredCountriesaccept bare ISO codes ("IN") as well asCountryobjects. Unknown codes are dropped. (#95) - PhoneInput: opt-in basic E.164 validation.
validatemarks a malformed non-empty numberaria-invalid, andonValidityChange(valid, e164)reports validity and the normalized number. No new dependency. (#95)
<PhoneInput
countries={["IN", "US", "GB", "LK"]}
preferredCountries={["IN", "GB"]}
validate
onValidityChange={(valid, e164) => setE164(valid ? e164 : "")}
/>Fixed
- PhoneInput: country search ignores accents and curly apostrophes, and matches common former names ("turkey", "ivory coast", "czech republic", "swaziland"), including under a non-English
displayLocale. Hong Kong and Macao keep their short names. (#105) - PhoneInput: the preferred-countries divider is placed correctly when a
CountryinpreferredCountriesuses a lowercase code. (#105)
Docs
- Landing page and docs in Spanish, Japanese and Arabic, translated with Babelize, with a language dropdown. (#97, #98, #99, #100, #101)
- Translated metadata,
hreflanglinks and a sitemap for every language. (#102) - Docs UI text and search follow the page's language. (#103)
Full changelog: v2.0.2...v2.1.0