CountriesDropdown

fun CountriesDropdown(expanded: Boolean, onDismiss: () -> Unit, onSelectCountry: (Country) -> Unit, countriesToShow: List<String> = emptyList(), countriesExclude: List<String> = emptyList(), pinnedCountries: List<String> = emptyList(), ccpColors: CCPColors = CCPDefaults.colors(), ccpConfig: CCPConfig = CCPDefaults.defaultConfig(), modifier: Modifier = Modifier, dropdownOffset: DpOffset = DpOffset.Zero)(source)

A compact, searchable dropdown for country selection, anchored below the country selector button. Intended as an alternative to CountriesBottomSheet for tablets, landscape layouts, or forms where a full-screen modal feels too heavy.

Controlled by the caller via expanded / onDismiss, matching the pattern of Material3's DropdownMenu.

Note: the country list uses Column + verticalScroll rather than LazyColumn because DropdownMenu measures its children's intrinsic sizes to size the popup, and SubcomposeLayout-based components (LazyColumn) do not support intrinsic measurement. Search filtering keeps the rendered count small in practice.

Parameters

expanded

Whether the dropdown is currently open.

onDismiss

Called when the user taps outside or selects a country.

onSelectCountry

Called with the chosen Country.

countriesToShow

Whitelist of ISO codes to display. Empty = all countries.

countriesExclude

ISO codes to hide from the list.

pinnedCountries

ISO codes shown in a "Suggested" section at the top.

ccpColors

Color configuration.

ccpConfig

Behavior and UI configuration (header style, flag visibility, etc.).