CountrySelector

fun CountrySelector(selectedCountry: Country?, onCountrySelect: (Country) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, locale: String? = null, selectorPicker: @Composable (selectedCountry: Country?, onCountrySelect: (Country) -> Unit) -> Unit = { selectedCountry, onCountrySelect -> CountryPicker( selectedCountry = selectedCountry, onClick = onCountrySelect, modifier = Modifier .fillMaxWidth() .fillMaxHeight(0.75f), locale = locale, ) }, selectorField: @Composable (country: Country?, onClick: () -> Unit) -> Unit = { country, onClick -> CountrySelectorDefaults.SelectorField( country = country, onClick = onClick, modifier = modifier, enabled = enabled, locale = locale, ) })

Country selector with a clickable field that opens a bottom sheet.

Parameters

selectedCountry

Currently selected country, or null if none

onCountrySelect

Callback invoked when a country is selected in the picker

modifier

Modifier applied to the field

enabled

Whether the field is enabled

locale

BCP 47 language tag for localized picker text, or null for system default

selectorPicker

Picker content shown inside the bottom sheet

selectorField

Clickable field content to toggle the picker

See also