Names of Controls (Accessible Names)
An accessible name is the "name" of a button, link, input, image, and so on. Screen readers announce it, and voice control users speak it to target the control. The browser computes the name from the element's content and attributes. It is not something you paste on afterwards with aria-label.
Good names are decided before implementation. Even for icon-only buttons or a row of "Read more" links, a developer who receives the names can apply them as intended.
| Step | Main owner | Task |
|---|---|---|
| 1. Decide names in the copy and wireframes | Director, information architect | Decide the names that follow from the content: images, inputs, links, navigation |
| 2. Decide names in the design | Designer | Decide the names that follow from the visuals, such as icon-only buttons |
| 3. Hand the names over | Designer → developer | Write the names down separately from the visuals |
| 4. Assign names in implementation | Developer | Apply the specified names in a way that matches the screen |
| 5. Verify the names | Reviewer | Confirm that each element has the specified name |
1. Decide Names in the Copy and Wireframes
Whoever decides a screen's content and wording decides its names. When the same person decides the names, they match the on-screen wording and stay consistent across pages.
- For every image, decide whether it needs alternative text and what it says, or whether it is decorative MUSTA11Y-R11
- The person who chose the image knows best what it is meant to convey. For images containing text, the alternative text is that text.
- Check:
IA-01QA-20QA-20Image alt text✕ NGMissing alt; noisy alt on decoration✓ OKMeaningful alt; empty alt for decoration
- For every input, decide its visible label and any required or format hints MUSTA11Y-R12
- A visible label keeps the field's purpose in view while the user types and gives the input a reliable name. Even when the layout cannot show a label, decide the wording of the label to be read out.
- Check:
IA-08QA-40QA-40Required and format hints✕ NGRequired? What format? Unknown✓ OKRequired and format sit by the label
QA-27QA-27Not placeholder alone✕ NGThe placeholder is the only name✓ OKA label provides the name
- Make each link's purpose clear from its text or its surrounding context MUSTA11Y-R13
- Links whose purpose is clear can be told apart even by users who move through the links alone with a screen reader. For repeated links on cards, either make the visible text specific or decide the words (such as the article title) to add for screen readers.
- Check:
IA-04QA-30
| NG | OK |
|---|---|
| Repeated links with the same text; destinations cannot be told apart | The visible text stays; the article title is added after it for screen readers only |
- When a page has more than one navigation region, decide a name for each MUSTA11Y-R14
- With a name each, users can tell the global navigation, breadcrumb, and footer links apart and move between them. Use short names that leave out the role itself, such as "Global" and "Breadcrumb".
- Check:
STR-03STR-03Distinguish multiple navs✕ NGCannot tell the navs apart✓ OKaria-label tells them apart
- Give every dialog a heading that describes its content MUSTA11Y-R15
- Assistive technologies announce a dialog's name first when it opens. A descriptive heading tells users right away what they are confirming.
- Write names in the page's primary language SHOULDA11Y-R16
- Names in the page's language, such as 「メニュー」 and 「閉じる」 on a Japanese page, are read naturally by the speech engine. The exception is when the design explicitly specifies English wording.
- Check:
QA-62QA-62Name language✕ NGName is in a different language✓ OKName uses the page language
2. Decide Names in the Design
Decide the names of controls with no text on screen, and of wording shortened for the layout, at the design stage.
- Decide a name for every icon-only button and include it in the handoff MUSTA11Y-R17
- With a specified name, a developer can name even a control with no visible text as intended. Describe what happens when the button is pressed ("Open site search"), not what the icon looks like ("magnifying glass").
- Check:
DS-04QA-21QA-21Icon button name✕ NGIts purpose is not announced✓ OKIts purpose is announced
| NG | OK |
|---|---|
| No name specified, so the developer guesses one from the look | The name says what happens when it is pressed |
- When adding screen-reader-only context, keep the visible text at the start of the name MUSTA11Y-R18
- Voice control users speak the text they see. Starting with the visible label, as in "Read more about the spring update", lets the spoken words match the name.
- Check:
DS-07QA-22QA-22Label in name✕ NGVisible text is not in the name✓ OKVisible text is in the name
- Name elements after their role for users, not after how they look or what the team calls them SHOULDA11Y-R19
- The three-line button the team calls the "hamburger menu" is, to users, the button that opens the "main navigation". A name based on its role tells users what opens.
- Check:
DS-04QA-64
| NG | OK |
|---|---|
| The visual nickname is used as the name | The name describes what it opens (its role) |
- Give components with the same function the same name across pages SHOULDA11Y-R20
- Consistent names for search, close, or print buttons let users recognize the same function on every page. Keep the list of names alongside the design components.
- Check:
DS-17QA-66
3. Hand the Names Over
Most names never appear on screen, so writing them down separately from the visuals gets them across reliably: in design-file annotations (such as Figma annotations), a spec sheet, or a ticket. Any format works, as long as it states which element on which screen gets which name.
| NG | OK |
|---|---|
| Only the visuals are handed over; no names are written | Annotations hand over each icon's name separately from the visuals |
Hand over the following.
| Element | What to hand over | Example | Check |
|---|---|---|---|
| Icon-only button | A name describing what pressing it does | Magnifying glass at the top right of the header: "Open site search" | |
| Toggle button (menu, accordion) | A name (without the open/closed state) | Three-line (hamburger) icon: "Main navigation" | |
| Informative image | Alternative text | Photo of the shop front: "Shop entrance facing the main street by the station" | |
| Image or banner containing text | The text in the image | Campaign banner: "Spring sale until March 31" | |
| Decorative image | That it is decorative (not read out) | Ornamental rule beside a heading: decorative | |
| Input | Visible label, required indicator, format hints | Phone number: label "Phone number", hint "Digits only, no hyphens", required | |
| Input without a visible label | The label to be read out | Search field in the header: "Search this site" | |
| Links with the same text | The words that distinguish them, and whether they are visible or screen-reader-only | "Read more" on news cards: add the article title for screen readers | QA-30 |
| Link that opens a new tab | The wording that says so, and whether it is visible or screen-reader-only | Link to an external site: add "opens in a new tab" for screen readers | |
| Navigation (when there are several) | A name for each | "Global", "Breadcrumb", "Footer" | |
| Dialog | The heading text | Delete confirmation: "Remove from favorites?" | — |
| Data table | The table caption | Price table: "Monthly price by plan" |
Example handoff (news list screen)
| Element | Visible text | Name (read out) | Presentation |
|---|---|---|---|
| Magnifying glass icon in the header | None | Open site search | Screen-reader-only |
| "Read more" on each card | Read more | Read more about | Article title is screen-reader-only |
| Card thumbnail | None | Decorative (duplicates the article title) | Not read out |
| Filter select | Category | Category | Visible |
| Pagination | 1 2 3 Next | Navigation name "Pagination" | Screen-reader-only |
Tools can confirm after implementation that an element has a name, but only someone who knows the intent of the screen can judge whether the name is right. With the names written in the handoff, step 5 becomes a comparison against what was specified.
4. Assign Names in Implementation
Order of Methods
Apply the specified names using the methods below, in this order. The higher a method is, the less likely the screen and the announcement are to drift apart, and the easier it is to maintain.
| Order | Method | When to use |
|---|---|---|
| 1 | Visible text inside the element | Put text inside <button> or <a>. What is shown and what is announced always match |
| 2 | Native HTML association | <label for="…"> for inputs, alt for images, <caption> for tables |
| 3 | Visually hidden text (.visually-hidden) | When the design shows no text. The text stays in the DOM, available to machine translation and find-in-page |
| 4 | aria-labelledby attribute | Reference the id of a heading or label already on the screen |
| 5 | aria-label attribute | Only when none of the above is possible (such as distinguishing navigation regions that have no heading) |
- Define
.visually-hiddenin theutilitieslayer MUSTA11Y-R21 - Every project uses the definition in the code example "Defining
.visually-hidden" below, so that screen-reader-only text is hidden the same way everywhere. - Do not use
aria-labelon elements that can be named with visible text or visually hidden text MUST NOTA11Y-R22 - Naming with visible text or
.visually-hiddenkeeps the name available to machine translation and lets reviewers spot mistakes on screen. - Check:
QA-26QA-26Unneeded aria-label✕ NGaria-label duplicates the visible text✓ OKThe visible text is the name
- Do not name controls with only the
titleattribute orplaceholderMUST NOTA11Y-R23 - Naming with a visible label or the element's own text reaches every assistive technology the same way.
- Check:
Why Visible Text Comes First
| Reason | Details |
|---|---|
| Voice control (WCAG 2.5.3 Label in Name) | Users speak the text they see. If the name differs from the visible text, the spoken command does not match |
| Browser machine translation | Automatic translation translates text nodes but may skip text inside attributes such as aria-label |
| Ease of review | Visible text can be checked on screen; text inside attributes stays hidden until someone opens DevTools |
| Ignored on generic elements | aria-label on a <div> or <span> with no role is ignored by browsers |
How the Browser Picks the Name
Following the W3C "Accessible Name and Description Computation" specification, browsers check name sources in the following order and use the first non-empty string. Because aria-label takes precedence over visible text, adding aria-label="Submit" to a button that displays "送信" makes screen readers announce "Submit", which no longer matches the screen.
| Order | Source | Notes |
|---|---|---|
| 1 | aria-labelledby attribute | References the IDs of text elements on the page |
| 2 | aria-label attribute | Uses the attribute value as is |
| 3 | Native HTML association | <label for="…">, alt, <caption>, <legend>, <figcaption>, <summary> |
| 4 | The element's text content | Elements that take their name from content (<button>, <a>, headings, table cells) |
| 5 | title attribute, placeholder | Unreliable as names; do not rely on them |
Code Examples
Code example: icon-only buttons
<!-- This is wrong: the name exists only in an attribute, so translation and find-in-page miss it -->
<button type="button" aria-label="Main navigation" aria-expanded="false">
<svg aria-hidden="true">…</svg>
</button>
<!-- Correct: real text, hidden visually with CSS -->
<button type="button" aria-expanded="false">
<svg aria-hidden="true">…</svg>
<span class="visually-hidden">Main navigation</span>
</button>Code example: repeated "Read more" links
<!-- This is wrong: the name does not match the visible text (WCAG 2.5.3 violation) -->
<a href="/news/spring" aria-label="Read full details on spring update">Read more</a>
<!-- Best: make the visible text specific -->
<a href="/news/spring">Read spring update details</a>
<!-- Next best: keep the visible text first and append screen-reader-only context -->
<a href="/news/spring">Read more<span class="visually-hidden"> about the spring update</span></a>Code example: search and other inputs
<!-- This is wrong: placeholder used in place of a label -->
<input type="search" aria-label="Search site" placeholder="Search site" />
<!-- Correct: a label element, hidden visually if the design requires it -->
<label for="site-search" class="visually-hidden">Search site</label>
<input type="search" id="site-search" name="q" placeholder="Enter keywords" />Code example: distinguishing navigation and sections
When a page has more than one <nav>, distinguish them with aria-label or aria-labelledby. Do not repeat the role in the name: aria-label="Global Navigation" is announced as "Global Navigation navigation".
<!-- Navigation without a visible heading -->
<nav aria-label="Global">…</nav>
<nav aria-label="Breadcrumb">…</nav>
<!-- A section with a visible heading references it with aria-labelledby -->
<section aria-labelledby="related-heading">
<h2 id="related-heading">Related Articles</h2>
…
</section>Code example: dialogs
<!-- Use the dialog's heading as its name -->
<dialog aria-labelledby="remove-dialog-title">
<h2 id="remove-dialog-title">Remove from favorites?</h2>
…
</dialog>Code example: defining .visually-hidden
display: none and visibility: hidden remove the element from the accessibility tree as well, so they cannot be used for screen-reader-only text.
@layer utilities {
.visually-hidden:not(:focus):not(:active) {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
border: 0;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
}5. Verify the Names
- For each element listed in the handoff, open "Computed Properties → Name" in the DevTools Accessibility pane and confirm the name matches what was specified (see the Accessibility pane).
- For every element with visible text, confirm that the text appears at the start of the name.
- Search the source for
aria-labeland confirm each use has a reason it cannot be replaced by visible text or.visually-hidden.