Skip to main content
No Result Found

non-text-contrast

Ensure that all user interface components have a contrast ratio of at least 3:1 against their adjacent colors.

Rule Severity : Serious

Description

The non-text-contrast rule ensures that all non-text user interface components and graphical elements have sufficient contrast (minimum 3:1) against adjacent colors. This includes interactive elements like buttons, text inputs, checkboxes, radio buttons, etc.

This rule aligns with WCAG Success Criterion 1.4.11 (Non-text Contrast), which requires that visual elements essential for understanding or interaction meet minimum contrast thresholds.

WCAG considers buttons with visible text as passing Non-Text Contrast because users recognize them as interactive elements. However, WCAG does not clearly specify what constitutes visibility in the criteria. In our rule, if button text does not pass the minimum 3:1 contrast with the button’s base color, then this is considered a failure for non-text-contrast. This check ensures that users can see the button text clearly.

Examples

In the following example, a checkbox fails the non-text-contrast rule due to insufficient contrast between the elements of the checkbox:

Incorrect sample
Copy icon Copy

Note the lack of contrast in the html output:

A screenshot of a gre-themed checkbox. There is very little contrast between the elements of the checkbox

In contrast, the following code snippet has sufficient contrast between the different elements f the checkbox. This contrast ensures that the non-text-contrast rule is followed.

Correct sample
Copy icon Copy

Note the contrast in the html output:

A screenshot of a checkbox. The checkbox elements like text, tick mark, background color, etc. has ample contrast between each other

How to fix?

To comply with the non-text-contrast rule:

  • Verify contrast ratios (≥3:1) for all UI components against adjacent colors.

  • Test graphical elements (icons, charts, diagrams) against their backgrounds.

  • Ensure visual distinctions (e.g., graph lines, chart segments) meet the contrast requirement.

  • Check all component states (hover, focus, disabled, etc.) for consistent contrast.

Reference

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle