Segmented control
View mode: the outline slides; the preview below swaps (Tab in, Arrow keys)
Text only: 2 · 3 · 5 segments
NockerlIcon + label · icon only, sm and md
A disabled segment: skipped by arrow keys, still legible
Full-width: equal-share segments fill the row
Disabled control: dimmed but readable, not interactive
Viewing list · range week · diff unified. The outline slides to the active segment. The island is live.
Parameters
Section titled “Parameters”Segmented control is the connected, single-track view/mode switch, distinct
from its neighbours: tabs navigate page/section content
(each tab owns a tabpanel; role="tablist"), whereas a segmented control just
flips a small set of mutually-exclusive views/modes with no associated panels
(role="radiogroup"). A radio group is the same
single-choice intent but looser and labelled: separate rows that can carry
descriptions; reach for it for 4+ rich choices, and for the segmented control for
2 to 5 compact peers.
Real divergences between the shipped platforms:
- Active-segment treatment (ratified): the selected segment is the sliding cyan
outline, accent border + accent ink with no wash, per design laws §6 and §7, which name
the filled cyan pill as the former treatment. The Swift idiom on this page already draws
that outline at the selection weight (
border.width.selection@border.opacity.selection); the published Compose control still fills its active segment, so Android is the platform that converges here. - The slide. Settled alongside it: the marker animates transform + width, never the fill, wherever the control is ours. Compose already slides its indicator; the Swift idiom cuts straight to the new stroke and adopts the slide.
- Track surface (ratified): the track is a flat neutral hairline container with zero
fill, on the 12px control radius with a 2px inset, grouping the segments as connected
peers. It carries no recessed inset-shade, because with the active segment reading by
outline there is no fill for a well to sit under. Swift and web both draw this. Compose
still uses a
cardAlt2well, which converges when Android does.