# Name, Role, Value: Controls Screen Readers Understand

Source: https://allyway.ai/glossary/name-role-value

Name, Role, Value is WCAG success criterion 4.1.2: for every user interface component, the name and role can be programmatically determined, user-settable states, properties and values can be programmatically set, and changes are announced to assistive technologies. It is Level A.

Name, Role, Value is the rule that makes controls understandable for assistive technology. A screen reader has to know what a control is called ("Search"), what it is (a button, a checkbox, a menu) and what state it is in (checked, expanded, 3 of 5). When a `div` is styled to look like a toggle but exposes none of this, sighted mouse users can use it – everyone else hears "clickable" or nothing at all.

## What it means

[WCAG 4.1.2 Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html) is a Level A criterion of [WCAG 2.2](https://allyway.ai/regulations/wcag-2-2). For all user interface components – including form elements, links and components generated by scripts – it requires:

| Part | What it means | Typical source |
|---|---|---|
| Name | The control's label can be read by software | Visible text, `<label>`, `aria-label`, `aria-labelledby` |
| Role | What kind of control it is | Native element (`<button>`, `<input>`) or an ARIA role |
| State, property, value | Current status that users can change | `checked`, `aria-expanded`, `aria-pressed`, slider value |
| Notification | Changes reach assistive technologies | Native behavior or updated ARIA attributes |

The W3C note is reassuring: the criterion is primarily for authors who build or script their own components. Standard HTML controls already meet it when used according to the specification. The trouble starts with custom widgets: toggles, [tabs](https://allyway.ai/glossary/accessible-tabs), [accordions](https://allyway.ai/glossary/accessible-accordion), [comboboxes](https://allyway.ai/glossary/accessible-combobox) built from `div` and `span`.

> **Note:** > **Native first**
> A real `<button>` brings its role, keyboard support and focus for free. W3C lists using script to turn a `div` or `span` into a control without exposing its role as failure F59.

People who rely on this criterion use [screen readers](https://allyway.ai/glossary/screen-reader), screen magnifiers and speech recognition software. A speech user can only say "click Search" if the button's [accessible name](https://allyway.ai/glossary/accessible-name) really is "Search".

## Examples

```html title="Example"
<!-- Custom toggle: name, role and state are exposed -->
<button type="button" aria-pressed="false" id="dark-mode">
  Dark mode
</button>

<!-- Disclosure: state changes with every click -->
<button type="button" aria-expanded="false" aria-controls="faq-1">
  Shipping costs
</button>
<div id="faq-1" hidden>Shipping is free from €50.</div>
```

The script toggles `aria-pressed` or `aria-expanded` together with the visual change. That covers the "value" and "notification" parts: the screen reader announces "Shipping costs, button, collapsed" and then "expanded". The W3C techniques behind this are ARIA4 (a role) and ARIA5 (state and property attributes) – see [ARIA](https://allyway.ai/glossary/aria) for the basics.

**Do:** Do

Use native elements wherever possible, give every control a name that matches its visible text, update `aria-expanded`, `aria-pressed` or `aria-checked` whenever the state changes, and keep custom widgets fully usable with [keyboard navigation](https://allyway.ai/glossary/keyboard-navigation).

**Don't:** Don't

Build buttons from clickable `div` elements, leave icon buttons without a name (an [empty button](https://allyway.ai/glossary/empty-button)), show a "checked" style that the code never exposes, or add a role without the keyboard behavior it promises.

## How to check Name, Role, Value



## Questions

Q: What does Name, Role, Value mean in WCAG?
A: It is success criterion 4.1.2 at Level A. Every control must expose what it is called, what kind of control it is and its current state or value to assistive technology, and changes must be announced.

Q: Do standard HTML elements pass 4.1.2 automatically?
A: Yes, when they are used according to the specification. A `<button>` with text or a labeled `<input type="checkbox">` already exposes name, role and state. The criterion mainly concerns custom components.

Q: Is ARIA required to meet Name, Role, Value?
A: No. Native HTML is the first choice. ARIA is needed when you build a component HTML does not offer, or to add a state such as `aria-expanded` to a button that controls a section.

Q: What are common Name, Role, Value failures?
A: Controls without a programmatically determined name (F68), `div` or `span` elements scripted into controls without a role (F59), text alternatives that are not updated when an image changes (F20), and form fields with several parts but only one name (F86).

Q: How is 4.1.2 different from the accessible name?
A: The accessible name is one part of 4.1.2. The criterion also requires the role, the current state and value, and that changes are passed on to assistive technologies.
