Segmented Control
Alignment target:@astryxdesign/core v0.7.1 · SegmentedControl
Color contrast
Measure the foreground and background as they appear together on screen. The ratios below are the WCAG 2.2 AA checks for this component.
| Check | Ratio | Applies to | Guidance |
|---|---|---|---|
| Text label | 4.5:1 | Rest, Hover, Pointer down, Selected | Each label must have at least 4.5:1 contrast with its segment background. Check unselected, Hover, Pointer down, and selected colors as they appear on screen. For Hover and Pointer down, measure the final background after the overlay is applied. 1.4.3 Contrast (Minimum) |
| Essential icon | 3:1 | Icon only | When a segment has no visible label, its icon must have at least 3:1 contrast with the segment background. An icon beside a visible label does not need its own check. 1.4.11 Non-text Contrast |
| Selected state indicator | 3:1 if relied upon | Selected | The selected background must reach 3:1 only when users need it to tell selected from unselected. Label color and weight also show selection. 1.4.11 Non-text Contrast |
| Visible control boundary | 3:1 if needed | Rest | The control edge or segment borders need at least 3:1 contrast when users need them to see the choices. 1.4.11 Non-text Contrast |
| Keyboard focus indicator | 3:1 | Focus visible | The focus outline must have at least 3:1 contrast with the area around the segment. Check it on the track and selected background. 1.4.11 Non-text Contrast |
| Disabled appearance | Not required | Disabled | Disabled controls do not need to meet these contrast ratios. 1.4.3 and 1.4.11 exceptions |