Use ISO alpha-2 country codes for filtering and preferences
masterThe MuiTelInput component uses two-letter ISO alpha-2 country codes (e.g., US) to manage country selection. You can use these codes with the following properties to customize the input behavior:
onlyCountries: A list of country codes that are the only ones allowed to be selected.excludedCountries: A list of country codes that are forbidden from being selected.preferredCountries: A list of country codes that should appear at the top of the selection list.
The library supports all officially assigned ISO alpha-2 codes, plus a few additional ones such as AC (Ascension Island), TA (Tristan da Cunha), and XK (Kosovo).
// Example usage of country code properties
<MuiTelInput
onlyCountries={['US', 'CA']}
preferredCountries={['FR', 'GB']}
excludedCountries={['CN']}
/>