CountryIndexRail

fun CountryIndexRail(letters: List<Char>, onLetterSelected: (Char) -> Unit, modifier: Modifier = Modifier, style: CountryPickerStyle = CountryPickerTheme.style)(source)

The A–Z rail down the edge of a long country list.

236 rows is roughly fifteen screens. Search covers the case where the user knows the name; this covers the case where they are browsing, or know only roughly where a country falls, and it is the interaction people already expect from a long indexed list on both platforms.

Interaction

Tap a letter to jump; drag along the rail to scrub continuously, which is the faster gesture and the reason this is not simply a column of buttons. A light haptic fires on each letter change during a drag — not on each pointer event — so scrubbing feels like passing detents rather than one continuous buzz.

Accessibility

The rail is hidden from the accessibility tree (clearAndSetSemantics {}). It is a redundant shortcut to rows a screen-reader user already reaches by swiping through the list, and exposing 26 unlabelled single-character targets in front of that list makes the list harder to use, not easier. Search remains the accessible fast path.

Parameters

letters

Letters to draw — pass CountryListIndex.letters so the rail only offers letters that lead somewhere.

onLetterSelected

Called with a letter when it is tapped or scrubbed onto. Called once per letter change, not once per pointer event.