# Accessible name

## What it is

An accessible name is the text a platform exposes as the identifying name of an interface element to assistive technology. A browser can use the text inside a button, an associated form label, or another source specified by the name computation rules. The result helps a screen reader announce the control and gives other tools information they can use to identify it.

The accessible name is part of an element's semantics. Role, state and description provide related information. A button can expose both the name Download PDF and a disabled state. A description can add details such as the type of file or a reason for being disabled. State can describe whether a disclosure is expanded. Keeping the name focused on identity helps people find and use the control.

The accessible name computation can draw from different sources in a defined order. Attributes that supply or reference text can change the result a browser exposes. A visible label can already name a native element. Inspect the computed value when adding a custom label, especially when markup combines text, icons and references. Test the result in each state that changes what the control does.

## Why it matters

An icon-only control can be clear to somebody who recognises its image and hard to identify when the image is unavailable. A screen reader may announce a generic role or a symbol name with little information about the task. A name such as View PDF makes the action clear. A second control called Download PDF is distinguishable even though both refer to the same document.

Visible and accessible wording influence other interaction methods as well. People using speech control can refer to text they see. When a control has a visible label, make the accessible name include that wording in a useful order. An added description can provide details without making the spoken control name difficult to match. Test meaningful distinctions between several similar controls on one page.

Names can become stale as features change. A control that starts or stops a process may need a name reflecting its next action, while a toggle can expose its state through the relevant semantic property. Decide which information belongs in each channel and keep it consistent across states and languages. A text label that names a real action is easier to review and localise than a string that describes artwork.

## What it looks like in practice

Imagine a page with a list of documents, each offering separate view and download controls. Give the controls names that distinguish the action and the document where that distinction is needed. Test a small section containing two documents with similar titles. A person moving through the controls should be able to choose the second document's download without having to infer the purpose from its position.

Inspect the accessibility tree for the normal state, the focused state and any state that changes the possible action. Compare the actual spoken or computed name with visible text. If a reference supplies the name, check that its target exists and that the order of combined text makes sense in the page's own language. Try the interface after changing an item's title and look for controls that still refer to the old one.

Engineer's icon-control accessibility case study describes naming actions in a native app and updating names for controls whose actions depend on state. It also describes a linter that checks for a nearby label and explains that the label's usefulness still needs human review. The document example applies the same distinction to web controls. A structural test can establish that a name exists. A rendered and contextual review can establish that it helps a user choose the intended operation.

Record a known useful announcement alongside the fixture. Check how the control is reached and how similar controls appear together. On a translated page, inspect punctuation and word order as well as whether the control is named. These checks give a maintainer a meaningful result when UI copy changes later.

## Where it goes wrong

A label can override useful visible text. For example, an icon and a nearby word might already name a button, but an added attribute can replace that name with generic wording. Look at the computed result before adding another source. Prefer an ordinary visible label when the design supports it, and give an icon-only control text that communicates its action.

Another pitfall is assuming that a title, tooltip or placeholder will always supply the intended name. Determine which native mechanism applies to that element and check that the text is present when the component can be operated. For a form control, test the input with its label and error message both present. Name and description should still make sense as the user enters data.

Control labels are often assembled from several pieces of text. A reference to an action word and a document title can be useful, but the order that reads well in one language may be awkward in another. Keep the complete name available to translators and check its final rendering. Include long item names and several controls with similar words. Spacing, punctuation and abbreviation choices can determine whether the name is easy to understand when announced outside its visual context.

Finally, treat automated checks as evidence for the properties they inspect. An audit may confirm that a control has a name while leaving its meaning to a reviewer. Listen to or inspect the actual result in the relevant context. A useful accessible name should remain understandable when read alongside other controls or reached by a person who has not seen the icon.

## Further reading
* W3C Accessible Name and Description Computation. Specifies how names and descriptions are calculated.
* WAI guidance on accessible names and descriptions. Explains practical choices for controls and widgets.
* WCAG Name, Role, Value. Describes why interface semantics need to reach assistive technology.

=> /portfolio/named-all-17-icons-for-screen-readers/ icon-control accessibility case study
=> https://www.w3.org/TR/accname-1.1/ W3C Accessible Name and Description Computation
=> https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/ WAI guidance on accessible names and descriptions
=> https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html WCAG Name, Role, Value

=> https://engineer.company/glossary/accessible-name/ This page on the web
