Skip to content

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.

Steps for deciding names
StepMain ownerTask
1. Decide names in the copy and wireframesDirector, information architectDecide the names that follow from the content: images, inputs, links, navigation
2. Decide names in the designDesignerDecide the names that follow from the visuals, such as icon-only buttons
3. Hand the names overDesigner → developerWrite the names down separately from the visuals
4. Assign names in implementationDeveloperApply the specified names in a way that matches the screen
5. Verify the namesReviewerConfirm 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-01 QA-20QA-20 Image alt text✕ NGMissing alt; noisy alt on decorationThe chart image has no alt, and a decorative line has alt="line"✓ OKMeaningful alt; empty alt for decorationThe chart alt describes its content; the decorative line has alt=""
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-08 QA-40QA-40 Required and format hints✕ NGRequired? What format? UnknownThe phone field says nothing about being required or the expected format✓ OKRequired and format sit by the labelThe phone label shows Required and "Digits only, no dashes" QA-27QA-27 Not placeholder alone✕ NGThe placeholder is the only nameThe field has no visible label; only the placeholder "Email address" names it✓ OKA label provides the nameAn "Email address" label sits above the field; the placeholder is just an example
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-04 QA-30
NG and OK examples: repeated links
NGOK
All three card links are announced as "Read more" and cannot be told apartEvery card still shows "Read more", and the article title is added for screen readers only, so each link is announced distinctly, such as "Read more about New shop"
Repeated links with the same text; destinations cannot be told apartThe 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-03 Distinguish multiple navs✕ NGCannot tell the navs apartThere are two nav elements and neither has a name✓ OKaria-label tells them apartThe two nav elements are named "Global menu" and "Footer menu" with aria-label, which say what each is for
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-62 Name language✕ NGName is in a different languageOn an English page, the button name is in Japanese✓ OKName uses the page languageOn an English page, the button name is in English too

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-04 QA-21QA-21 Icon button name✕ NGIts purpose is not announcedA magnifier icon button is announced only as "button"✓ OKIts purpose is announcedThe magnifier icon button is announced as "Search, button"
NG and OK examples: icon-only buttons
NGOK
No name is specified for the magnifying glass icon, so the developer guesses from its look and it is announced as "Magnifying glass"The magnifying glass icon is specified as "Open site search", naming what pressing it does, and is announced that way
No name specified, so the developer guesses one from the lookThe 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-07 QA-22QA-22 Label in name✕ NGVisible text is not in the nameThe button shows "Send" but its accessible name is "Complete form"✓ OKVisible text is in the nameThe visible "Send" is also the accessible 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-04 QA-64
NG and OK examples: visual nicknames
NGOK
The three-line icon is named with the team's nickname "Hamburger menu", which says nothing about what opensThe three-line icon is specified as "Main navigation", naming what it opens, and is announced that way
The visual nickname is used as the nameThe 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-17 QA-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 and OK examples: handing over names
NGOK
The design file shows only how the screen looks; the names of the three-line and magnifying glass icons are written nowhereNumbered annotations on the two icons in the design file hand over the names "Main navigation" and "Open site search"
Only the visuals are handed over; no names are writtenAnnotations hand over each icon's name separately from the visuals

Hand over the following.

What to hand over for each element
ElementWhat to hand overExampleCheck
Icon-only buttonA name describing what pressing it doesMagnifying 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 imageAlternative textPhoto of the shop front: "Shop entrance facing the main street by the station"
Image or banner containing textThe text in the imageCampaign banner: "Spring sale until March 31"
Decorative imageThat it is decorative (not read out)Ornamental rule beside a heading: decorative
InputVisible label, required indicator, format hintsPhone number: label "Phone number", hint "Digits only, no hyphens", required
Input without a visible labelThe label to be read outSearch field in the header: "Search this site"
Links with the same textThe words that distinguish them, and whether they are visible or screen-reader-only"Read more" on news cards: add the article title for screen readersQA-30
Link that opens a new tabThe wording that says so, and whether it is visible or screen-reader-onlyLink 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"
DialogThe heading textDelete confirmation: "Remove from favorites?"—
Data tableThe table captionPrice table: "Monthly price by plan"
Example handoff (news list screen)
Visible text, names, and presentation by element
ElementVisible textName (read out)Presentation
Magnifying glass icon in the headerNoneOpen site searchScreen-reader-only
"Read more" on each cardRead moreRead more aboutArticle title is screen-reader-only
Card thumbnailNoneDecorative (duplicates the article title)Not read out
Filter selectCategoryCategoryVisible
Pagination1 2 3 NextNavigation 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 of naming methods
OrderMethodWhen to use
1Visible text inside the elementPut text inside <button> or <a>. What is shown and what is announced always match
2Native HTML association<label for="…"> for inputs, alt for images, <caption> for tables
3Visually hidden text (.visually-hidden)When the design shows no text. The text stays in the DOM, available to machine translation and find-in-page
4aria-labelledby attributeReference the id of a heading or label already on the screen
5aria-label attributeOnly when none of the above is possible (such as distinguishing navigation regions that have no heading)
Define .visually-hidden in the utilities layer 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-label on elements that can be named with visible text or visually hidden text MUST NOTA11Y-R22
Naming with visible text or .visually-hidden keeps the name available to machine translation and lets reviewers spot mistakes on screen.
Check: QA-26QA-26 Unneeded aria-label✕ NGaria-label duplicates the visible textThe link repeats its own visible text in aria-label✓ OKThe visible text is the nameThe link is named by its text alone, without aria-label
Do not name controls with only the title attribute or placeholder MUST 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 ​

Reasons visible text comes first
ReasonDetails
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 translationAutomatic translation translates text nodes but may skip text inside attributes such as aria-label
Ease of reviewVisible text can be checked on screen; text inside attributes stays hidden until someone opens DevTools
Ignored on generic elementsaria-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.

Sources the browser uses for the name
OrderSourceNotes
1aria-labelledby attributeReferences the IDs of text elements on the page
2aria-label attributeUses the attribute value as is
3Native HTML association<label for="…">, alt, <caption>, <legend>, <figcaption>, <summary>
4The element's text contentElements that take their name from content (<button>, <a>, headings, table cells)
5title attribute, placeholderUnreliable as names; do not rely on them

Code Examples ​

Code example: icon-only buttons
html
<!-- 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
html
<!-- 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
html
<!-- 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".

html
<!-- 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
html
<!-- 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.

css
@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 ​

  1. 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).
  2. For every element with visible text, confirm that the text appears at the start of the name.
  3. Search the source for aria-label and confirm each use has a reason it cannot be replaced by visible text or .visually-hidden.