Components
CountrySelect
Country selector with flag display.
Controlled: value (ISO 3166-1 alpha-2) drives the selection and onChange
reports the newly chosen code. A native <select> overlays the flag so the
picker keeps native keyboard and mobile behaviour. A divider on its trailing edge
shows only when it sits inside an input (PhoneInput or InputGroup).
Usage
Best practices
CountrySelectis the flag + native-<select>picker for a known country list; when users need type-to-filter, useCountryComboboxinstead.It is controlled-only - pass
value(ISO 3166-1 alpha-2) and anonChange; there is no uncontrolled/defaultValuemode.Give each option an alpha-2
value(e.g."US") so the overlaid flag resolves; a globe placeholder shows when the code is empty/unknown.
Props
Also exports
- const
countrySelectVariants - const
flagVariants
Composition
Builds on
Used by