WCAG 4.1.2 · Level A · EN 301 549 9.4.1.2

Name, Role, Value

Requires every interface component to expose its name and role, and its states and values, so assistive technology can use it.

In brief

A screen reader tells a user what a control is called, what it is, and what state it is in: "Subscribe, button", "Dark mode, switch, on". If a control is built from a div with a click handler, the screen reader announces nothing useful, and speech and switch users cannot target it.

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

What does it cover?

  • Name: Every user interface component has a programmatically determinable name. It can be visible or hidden.
  • Role: The role says what the component is: a button, a link, a check box, a tab.
  • States, properties and values: What the user can set can be set programmatically, and changes are notified. A state is a dynamic property, for example checked, expanded or selected. Focus is a particularly important state.
  • Native elements first: Standard HTML controls used according to specification already meet the criterion (H91, H88).
  • Custom components: The criterion is primarily for authors who build or script their own components. They need additional measures, such as ARIA roles, states and properties (ARIA4, ARIA5).
  • Names with ARIA: When a visible label cannot be used, aria-label can provide the name (ARIA14). aria-labelledby can point at nearby text (ARIA16).
  • User agents and assistive technology: A user agent is any software that retrieves and presents web content. Assistive technology works as, or alongside, a user agent.
  • Out of scope: Whether the name matches the visible label is 2.5.3. Whether the label is meaningful is 2.4.6. Status messages are 4.1.3.

Who does it affect?

Screen reader users, who rely on names, roles and states to understand and use controls. Users of speech recognition, who need a name to speak. Switch and keyboard users, whose software lists and activates controls by name. People who use screen magnifiers with focus following. Anyone using software that adapts the interface.

In the EAA and EN 301 549

The European Accessibility Act (Directive (EU) 2019/882) applies to in-scope products and services placed on the market after 28 June 2025. Recital 47 names four principles for websites and mobile applications: perceivable, operable, understandable and robust. Components that expose name, role and value are part of "robust".

The technical counterpart is the standard EN 301 549, which incorporates WCAG 4.1.2 by reference and turns it into separate clauses for each kind of ICT.

Where WCAG 4.1.2 appears in EN 301 549
ClauseType of ICTWhat it requires
9.4.1.2Web pagesWeb content must satisfy WCAG success criterion 4.1.2.
10.4.1.2Non-web documents (PDF, Office files)Documents must expose the name, role and value of interactive components where the standard applies the criterion to them.
11.4.1.2Non-web software (native mobile apps)Software must expose name, role and value to assistive technology through the platform accessibility services.

Whether and how the criterion applies to non-web documents is stated in clause 10 of the standard. Clause numbers follow the "9. + WCAG number" pattern of EN 301 549. In V3.2.1 the software clause is divided into further subclauses for open and closed functionality. Check the exact numbers in the standard when you cite them.

Standard version: EN 301 549 V4.1.1 (September 2026) is based on WCAG 2.2 and is the first version prepared specifically for the EAA. It has not yet been cited in the Official Journal of the European Union, so for now it is best treated as a voluntary technical route to the EAA's requirements. Once cited, it will give a presumption of conformity. The text of criterion 4.1.2 is the same in WCAG 2.1 and 2.2.

A note on EAA scope: Article 2(4) of the Directive excludes certain content from the requirements, for example office file formats published before 28 June 2025 and archives that are not updated after that date. Content you publish or change after that date is not covered by these exclusions.

Directive (EU) 2019/882, EUR-Lex, opens in a new tab

Code examples for the web

1. A div as a button

A div with a click handler has no role, no name and no keyboard support (F59). Use a button.

Incorrect
<div class="btn" onclick="subscribe()">Subscribe</div>
Correct
<button type="button" onclick="subscribe()">Subscribe</button>

2. An icon button with no name

A control with no programmatically determined name fails (F68). Give it one (ARIA14).

Incorrect
<button><svg>…</svg></button>
Correct
<button type="button" aria-label="Close"><svg aria-hidden="true">…</svg></button>

3. An image-only link

A link whose only content is an image needs a name from the image's text alternative (F89).

Incorrect
<a href="/home"><img src="logo.svg" alt=""></a>
Correct
<a href="/home"><img src="logo.svg" alt="Corpowid home"></a>

4. A custom check box with state

If you cannot use a native input, expose the role and the state, update the state when it changes, and support the keyboard (ARIA4, ARIA5).

Incorrect
<div class="check" onclick="this.classList.toggle('on')">Remember me</div>
Correct
<div role="checkbox" tabindex="0" aria-checked="false" id="remember">Remember me</div>
<script>
remember.addEventListener("click", toggle);
remember.addEventListener("keydown", e => { if (e.key === " ") { e.preventDefault(); toggle(); } });
function toggle() {
  const on = remember.getAttribute("aria-checked") === "true";
  remember.setAttribute("aria-checked", String(!on));
}
</script>

5. A disclosure that exposes its state

Tell assistive technology whether the panel is open.

Incorrect
<div class="head" onclick="toggle()">Details</div>
Correct
<button type="button" aria-expanded="false" aria-controls="panel">Details</button>
<div id="panel" hidden>…</div>

6. A fake link

A script that makes a span behave like a link loses the link role and keyboard access (F42). Use a real link.

Incorrect
<span class="link" onclick="location.href='/pricing'">Pricing</span>
Correct
<a href="/pricing">Pricing</a>

Code examples for mobile

Native components expose name, role and state automatically. When you build a custom control, set its role, its name and its state yourself.

iOS (SwiftUI)

import SwiftUI

struct DarkModeSwitch: View {
    @Binding var isOn: Bool

    var body: some View {
        // A custom control built from an Image. Give it a name, a role and a value
        Image(systemName: isOn ? "moon.fill" : "moon")
            .onTapGesture { isOn.toggle() }
            .accessibilityLabel("Dark mode")
            .accessibilityAddTraits(.isButton)
            .accessibilityValue(isOn ? "On" : "Off")
        // Better still, use Toggle("Dark mode", isOn: $isOn)
    }
}

Android (Jetpack Compose)

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.selection.toggleable
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.Role

@Composable
fun DarkModeRow(checked: Boolean, onChange: (Boolean) -> Unit) {
    // toggleable exposes the role, the state and the click action
    Row(
        modifier = Modifier.toggleable(
            value = checked,
            role = Role.Switch,
            onValueChange = onChange
        )
    ) {
        Text("Dark mode")
        // The visual switch is drawn here
    }
}

How to test

  • Inspect the accessibility tree: In the browser developer tools, check the name, role and state of every control.
  • Use a screen reader: Move through the controls. Does each one announce a name, a role and its state?
  • Check custom controls: For each, does it have a role, a name and state attributes that change when the user acts?
  • Check focus: Is the focus state exposed, and is the change of focus announced?
  • Check icon buttons and image links: Does each have a name? (F68, F89)
  • Check native alternatives: Could a native element be used instead of a custom one?
  • Use a checker as a starting point: Tools such as axe catch missing names and invalid ARIA. They cannot judge whether a custom widget behaves correctly, so a person must test with assistive technology.

Common mistakes

  • div and span controls: No role and no keyboard support (F59, F42).
  • Controls with no name: Icon buttons and image links (F68, F89).
  • A state that does not update: aria-expanded or aria-checked that never changes.
  • Wrong or invented roles: A role that does not match the behaviour.
  • Multi-part fields with no names: A phone number in three boxes with no name for each part (F86).
  • Visible text with no accessible name: A control that shows a label but exposes none (F111).
  • ARIA instead of native HTML: Adding roles to elements when a native one exists.
  • Not updating text alternatives: When non-text content changes (F20).

Sources

Standard version: EN 301 549 V4.1.1 (2026-09), WCAG 2.2. This page is for informational purposes only and is not legal advice. For binding requirements, refer to the official texts of the European Accessibility Act (Directive (EU) 2019/882) and EN 301 549.

Corpowid is recognized by Gartner

Corpowid has been recognized by Gartner, a leading global research and advisory firm, for our innovation and performance in digital accessibility. These badges reflect our commitment to creating inclusive, AI-powered web experiences.

Have questions about Corpowid?

Let’s connect.

We will get back to you as soon as possible.