What's in an (accessible) name?
Everything in an (accessible) UI needs an (accessible) name. For most controls, that’s automatic—they’ll have a good one by default. But sometimes you’ll need to specify one manually.


Let’s walk through how to use accessible names (and accessible descriptions!) in your UI. For example, you’ll know to name this button Visit DinoPark
—and to put other content into the description instead:
- HTML
What is an “accessible name” and “accessible description”?
Briefly: beyond their internal visual tree of controls & their children, most UI frameworks expose a programmatic one called the accessibility tree. ATs (like screen readers) can read this accessibility tree using standardized APIs (like UIA on Windows, NSAccessibility on macOS & iOS, ATK/AT-SPI on Android & Linux, and ARIA—which browsers translate into the other APIs — on the web).
As devs building accessible UI, we decide:
- Which controls appear in the accessibility tree,
- What properties are set on each control, and
- When to send notifications about changes to these controls & properties.
The most important of these properties is the control’s name (often called its accessible name to distinguish from its visible label).
The accessible name is usually the first thing a screen reader announces about a control, whereas other properties (like accessible description; we’ll get to it) announce later. For example:
Visit DinoPark, button, start your DinoPark visit today
It’s the first thing screen reader users hear, so a good accessible name is important.
Accessible names are usually correct — by default
But by default, most controls already have good accessible names.
UI frameworks vary, but usually they’ll automatically name controls based on visible content: a button with the label “Edit” will be named Edit
, a textbox labelled “First name” will be named First name
, etc. WinUI controls automatically generate names for themselves in most cases, as do SwiftUI controls, as does web content.
It’s truly rare to need a custom name. For example, these are all correct:
- HTML
- CSS
When do I need a custom accessible name?
In fact, I usually only use explicit names in a few circumstances:
- With images & icons - if I’m using an image or emoji as an icon, I’ll need a custom name to make it accessible to screen reader users.
- With messed-up UI - if I’m trying to fix already-written UI that didn’t follow other accessibility guidelines. For a good example, see the classic article Just use a (native HTML) button.
- With framework limitations - if I’m handling a well-known limitation in a UI framework. For example, WinUI struggles generating names for buttons that contain
StackPanel
s. - With groups of UI - if I’m trying to delineate groups of UI, I can name the container to create a context. This is worth an article all by itself.
And, in rare cases:
- When the default name is unclear - if the default name is ambiguous or is missing vital information.
What makes a name unclear? Let’s explain.
What is required?
First, let’s discuss what’s required of accessible names.
You probably rely on WCAG for your accessibility requirements (they’re a big part of what my work uses), but they’re surprisingly terse about names. Here’s what they require:
-
WCAG 4.1.2 - Name, Role, Value: among other things, every control must have a name that can be determined accessibly. Emphasis added:
For all user interface components (including but not limited to: form elements, links and components generated by scripts), 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.
-
WCAG 2.5.3 - Label in Name: the accessible name for every control must contain all visible “label” text.
For user interface components with labels that include text or images of text, the name contains the text that is presented visually.
-
WCAG 1.1.1 - Non-text content: even controls that are images must have a useful name.
All non-text content that is presented to the user has a text alternative that serves the equivalent purpose, except for [some exceptions].
-
WCAG 1.3.1 - Info and Relationships: all information must be available in text or programmatically.
Information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text.
Instead, most WCAG recommendations about accessible names come from separate, non-normative guidance, Providing Accessible Names and Descriptions (worth reading). They offer 5 “cardinal rules” and several guidelines, but nothing mandatory. This is a signal: good accessible names can’t be chosen merely by following requirements or an algorithm—they come from deliberate design.
For example, although both of these buttons are accessibly compliant, they are both poorly designed — even if the issue is only obvious to screen reader users:
- HTML
- CSS
Designing good accessible names
The guidelines at Providing Accessible Names and Descriptions are a great start, but I would summarize them like this — an accessible name should:
- Be very short (like 1–3 words)
- Be clear (explain what the control does)
- Be unique (can’t be confused with another control on the page)
And, the one actual rule about content (WCAG 2.5.3), it must:
- Contain any visible label (usually the visible label is all you need)
These guidelines become clear when you begin by understanding who you’re designing for: accessible names are used mostly by ① screen reader users and ② voice control users. For example:
-
Since screen readers present a linear “view” of your UI (they only read one word at a time!), long names can be incredibly frustrating. Think of how irritating it is to call a customer support line ("To contact the DinoPark billing department or the business administrator between 9AM and 5PM, please press 1…").
-
Since voice control users interact by literally asking the computer to click certain buttons (e.g., by saying, "double-click visit DinoPark"), names that don’t match visible labels are confusing.
This explains other guidance like “put the most distinguishing and important words first” and “do not include the word ‘button’ in the name of a button”. It all stems from the purpose of an accessible name—clearly identifying controls to people who cannot see or use the whole screen at once. The rest follows.
Alternative: just use the accessible description
Choosing good accessible names becomes simpler if you understand the alternatives to setting long ones.
Simply put: just use other properties—like the accessible description.
I often work with customers who want to ensure screen readers announce something: error messages, essential instructions, status, whatever. While you should be wary of trying to force specific announcements (see (Don’t) make Narrator read things), using other properties is a great way to expose information to screen readers. It’s method 2 in that article!
Unlike the accessible name, properties like accessible description have very few strict requirements—they must be correct & descriptive if present, but their use is only “strongly encouraged”, never required (WCAG 1.3.1). No, they’re designed to be flexible. In fact, although ARIA only has 1 descriptive property—accessible description—UIA on Windows has several properties you can use, from descriptions to help text to status. And macOS & iOS support literally any key-value pairs. No matter what you use, though, separating your names from your descriptions gives ATs flexibility — descriptions will still be read by default, but your users can change their order, read them separately, or even skip them altogether in familiar UI.
This flexibility makes choosing names much easier: put visible labels in the accessible name—put everything else in the description.
Examples
Let’s work through some examples.
Example: accessible names for images, emoji, and icons
Let’s start by fixing our initial example.
The emoji icon is clearly illustrative, so the emoji’s title ("sauropod") is probably not a great name. The button has a text description below to help visual users (your buttons do have a text label or a tooltip, right?), but it’s a bit wordy. Since the button already has a succinct tooltip (from its title
), let’s use that as the name, and the wordier text as the description:
- HTML
As a counterpoint, here we remove redundant emojis from the accessible name (since the rest of the label sufficiently describes the control):
- HTML
Example: use accessible description instead
Let’s fix the “Pay now” example from earlier.
It was worth distinguishing visually, so distinguish it for AT users, too. Use an accessible description instead of making the accessible name absurdly long:
- HTML
- CSS
Example: go beyond the visible label
Here’s a rare example where the visible label isn’t clear enough to distinguish the controls.
In fact, the design relies on layout cues that would be very hard to understand in a screen reader. You could add extra text to the accessible description, like above, but since this text is vital to disambiguate the buttons, it makes sense to modify the name. Besides, the small note about the T-Rex tour is a better use of the accessible description.
Notably, I made a design decision to put the verb last in the accessible name ("Stegosaurus tour register"). Since all the buttons have the same verb, I use the tour name first — to lead with the most-selective words first so scanning is easier. It’s probably not necessary here (and also a bit controversial: WCAG 2.5.3 recommends putting visible label text at the start of the name), but worth a demonstration:
- HTML
Example: create contexts
Here’s another example that emphasizes the design aspect of choosing names.
The controls in the DinoPark control panel below all have similar visible labels, but different effects. For example, we have ① a button to “Open” the escape tunnel to the helipad and ② a similar one to “Open” the tunnel to the raptor enclosure. The visible labels alone are ambiguous to screen reader users — when tabbing between them, they’ll simply hear Open, button
. Dangerous.
The WCAG naming guidelines above recommend choosing unique names for each: Open helipad tunnel
& Open raptor cages tunnel
.
But I, however, prefer contexts—if you name their containers “Tunnel to helipad” & “Tunnel to raptor cages”, you create contexts that screen readers will announce automatically when entered. This makes the screen reader experience a lot clearer in more-complicated interfaces: for example, the tunnel to the hotel can be opened and sealed permanently, and unique names would make things much wordier (Seal permanently, tunnel to hotel
?).
This approach is often simpler, but it’s a trade-off: what will happen when a voice control user says "Click Open"?
- HTML
- CSS
Example: bad names
And finally, let’s show some common mistakes:
- HTML
Hopefully it makes sense why these are mistakes: they hide critical information, add too much text, or otherwise make the UI more annoying to use.
Conclusion
In short, for accessible names:
- Rely on the defaults when you can
And if you can’t, keep those names:
- Short
- Clear
- Unique
And make sure they contain any visible label. Put everything else somewhere else — like the accessible description.
The first words in the ARIA guidance (Read Me First) are “No ARIA is better than Bad ARIA”. We want to make UI that’s accessible to everyone. But often that means doing nothing at all: your framework usually chooses good names automatically. Default accessible names can be confusing or difficult to use. But incorrect, custom accessible names can be impossible to use.
I hope now it’s clear why.
Thanks to Atherai Maran for editing & the dinosaur drawing. Thanks to Doug Geoffray for consulting. Tested with Narrator & NVDA in Edge on Windows 11.
Further reading
WCAG rules & guidance:
-
Intro to the guidelines: Read Me First (including "No ARIA is better than Bad ARIA")
-
All the rules: Web Content Accessibility Guidelines
- Understanding WCAG 4.1.2 - Name, Role, Value
- Understanding WCAG 2.5.3 - Label in Name
- Understanding WCAG 1.1.1 - Non-text content
- Understanding WCAG 1.3.1 - Info and Relationships
-
Guidelines for writing good accessible names: Providing Accessible Names and Descriptions
-
How the web calculates accessible names: Accessible Name and Description Computation 1.1
-
How browsers map ARIA to native accessibility APIs: Core Accessibility API Mappings
Related articles:
- “Visible label” vs "accessible name": Decoding Label and Name for Accessibility
- Avoid ARIA when you can: Just use a (native HTML) button
- More about accessible name & description: Foundations: accessible names and descriptions
- My article about forcing announcements: (Don’t) make Narrator read things
Appendix: About the article title
I remember reading an article with this title eons ago, but I haven’t been able to find it since. So I decided to write my own 😅. Can you find it? I’d love to link it.