Country Selector
A country field that opens the picker.
Controlled component
selectedCountry is the source of truth and the selector never changes it on its own — selection arrives through onCountrySelected. Hoist it in the caller:
var country by rememberSaveable { mutableStateOf<Country?>(null) }
CountrySelector(selectedCountry = country, onCountrySelected = { country = it })Appearance
variant chooses the footprint — a full field, a rich card, or a compact pill. Colors, flags, shapes and the picker's own presentation come from style (by default the nearest CountryPickerTheme).
Parameters
Which countries are offered and how selection behaves.
Convenience for state = Disabled. When false, state is ignored.
Interaction and validation state.
Field label. The pill variants have no room for one; it is still announced.
Shown while no country is selected.
Show the label, or keep it for accessibility only.
The ISO and/or dial code under the country name in the field.
Helper text below the field, replaced by errorText or successText in those states.
Marks the label and the accessibility description as required.
Recents persistence. The default persists nothing.
Country detection, or null to disable it.
What to do with a detection result.
Replaces the flag renderer everywhere this selector draws one.
Replaces the chevron, spinner and state icons.
Replaces the field's inner layout, keeping its click and accessibility behaviour — the escape hatch for a bespoke design.
Replaces the picker's row renderer.
Replaces the picker's no-results state.