Selection
Segmented control
A pill of two to five segments with exactly one selected, used to switch the view below it or the kind of thing a form adds.
In kanso-ui as SegmentedButton
Accessibility
- Each segment is a
<button type="button">witharia-pressed, and exactly one is"true". The set sits inrole="group"with anaria-labelthat says what it chooses: "Show", "What to log". - Tab moves through the segments; Enter or Space selects. The content changes at once and focus stays where it is.
- Targets: 36px inside a 44px track; above the 32px web minimum and the 24px of WCAG 2.2 AA, below the 48px phone target.
- Contrast, light / dark:
ink-mutedonsurface-sunken5.9 / 7.2:1;inkonsurface17.4 / 14.4:1; the focus ring onpaper7.3 / 9.0:1. - Motion: the selection moves without animation.