Toggle Button

Alignment target:@astryxdesign/core v0.7.1 · ToggleButton

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.

CheckRatioApplies toGuidance
Text label4.5:1Unselected, Selected, Hover, Pointer down

The label must have at least 4.5:1 contrast with the button background when selected and unselected. For Hover and Pointer down, measure the final background after the overlay is applied.

1.4.3 Contrast (Minimum)

Essential icon or spinner arc3:1Icon only, Loading

An icon-only ToggleButton must have at least 3:1 contrast between its icon and button background. The moving spinner arc must also meet 3:1. An icon beside a visible label does not need its own check.

1.4.11 Non-text Contrast

Selected state indicator3:1 if relied uponSelected

The selected background must reach 3:1 only when users need it to tell selected from unselected. Label weight or a changed icon can also show selection.

1.4.11 Non-text Contrast

Visible control boundary3:1 if neededRest

The button edge needs 3:1 contrast only when users need it to see the control. A visible label or icon can show the control instead.

1.4.11 Non-text Contrast

Keyboard focus indicator3:1Focus visible

The focus outline must have at least 3:1 contrast with the area around the button. Check both selected and unselected states.

1.4.11 Non-text Contrast

Disabled appearanceNot requiredDisabled

Disabled controls do not need to meet these contrast ratios.

1.4.3 and 1.4.11 exceptions

WCAG 1.4.3WCAG 1.4.11