CountryRegionFilters

fun CountryRegionFilters(selectedRegion: CountryRegion?, onRegionSelected: (CountryRegion?) -> Unit, modifier: Modifier = Modifier, regions: List<CountryRegion> = CountryRegion.entries, counts: Map<CountryRegion, Int> = emptyMap(), contentPadding: PaddingValues = PaddingValues(horizontal = CountryPickerTheme.style.dimensions.sheetHorizontalPadding), style: CountryPickerStyle = CountryPickerTheme.style)(source)

The region filter: a recessed track holding "All" and each region, with a raised pill that slides to the selected one.

One moving highlight, rather than chips that each light up, makes the change of filter something the eye can follow. The track scrolls horizontally on narrow screens and keeps the selected region in view. Each option reports Role.Tab and its selected state, so a screen reader announces "Africa, selected" rather than leaving the user to infer it from the highlight.

Parameters

counts

Countries per region, shown beside each label when com.ezzy.ccp.countrypicker.theme.CountryPickerLayout.showRegionCounts is on. Regions missing from the map show no count.