4.1 Compatible · SC 4.1.2

A2 min read

Name, Role, Value

For all user interface components, the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.

In plain language

Every button, link, checkbox, menu, or other control on a page must expose what it is (its role), what it's called (its name), and its current state (like checked, expanded, or selected) to assistive technology, in addition to showing it visually.

Why it matters

A screen reader can't tell that a styled box looks like a button. It relies on the underlying code to say "this is a button, named Submit, and it's currently disabled." If custom controls don't expose this information, screen reader users can't tell what they're interacting with, or whether their action worked.

In practice

Fails this criterion

A custom dropdown is built from styled boxes, and nothing marks it as a dropdown. When a screen reader user reaches it, they hear nothing, with no clue what it is or how to open it.

Meets this criterion

The same dropdown is built so a screen reader announces "Country, dropdown, collapsed" when it's reached. The user knows right away where they are, what it is, and that they can open it, and hears an update when it expands.

Test it yourself

Turn on a screen reader (VoiceOver, NVDA, or similar) and tab through every interactive element on the page. For each one, you should hear what it is, its name, and its state. If a control is silent, or is only announced as "clickable" with no name, this criterion is failing.

Read SC 4.1.2 on the official WCAG 2.2 specification ↗