Phone Country Code Selector
fun PhoneCountryCodeSelector(selectedCountry: Country, onCountrySelected: (Country) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, config: CountryPickerConfig = CountryPickerDefaults.phoneConfig(), sheetTitle: UiText = UiText.resource(Res.string.ccp_country_code_title), sheetSubtitle: UiText? = UiText.resource(Res.string.ccp_country_code_subtitle), recentCountryStore: RecentCountryStore = NoOpRecentCountryStore, repository: CountryRepository = CountryRepository.Default, style: CountryPickerStyle = CountryPickerTheme.style, flagContent: @Composable (Country) -> Unit? = null)(source)
A standalone dial-code pill — 🇰🇪 +254 ˅ — that opens the country-code picker.
PhoneNumberField already has a prefix built in; this is for a host composing its own phone row that wants the identical picker rather than reimplementing one. It opens the same sheet as every other selector, with dial codes on the rows and dial-code search enabled.
Parameters
selected Country
The country whose dial code is shown.
on Country Selected
Called with the chosen country. The caller re-formats and re-validates its number — PhoneNumberField does that itself.