We'd like to set Google Analytics cookies to learn how people use the Knowledge Base, so we can improve it. We set them only if you accept.

Skip to main content
Digital Accessibility Knowledge Base

aria-command-name

Web validation

Elements with ARIA command roles such as button, link, or menuitem must expose a non-empty accessible name.

Every interactive command needs a text alternative so assistive technologies can identify and announce it. When a button, link, or menuitem is built with generic elements and ARIA roles, that alternative is provided through visible text or attributes like aria-label, aria-labelledby, or title. Without a name, users of screen readers, voice control, or low-vision tools cannot determine the control’s purpose and may be unable to operate it.

Pass Patterns

ARIA-based button named by its text content

The <div> below is given the button role and contains visible text, so its accessible name is “Submit”.

HTML
<div role="button" tabindex="0">Submit</div>

This link role element uses aria-labelledby to reference text found elsewhere in the page.

HTML
<div id="product-link-text">Go to product page</div>
<div role="link" tabindex="0" aria-labelledby="product-link-text"></div>

Fail Patterns

An ARIA-based button with only non-text content

The button’s only content is an image with an empty alt attribute, leaving the button without an accessible name.

HTML
<div role="button" tabindex="0">
    <img src="/icons/heart.png" alt="" />
</div>

An ARIA-based button with an empty aria-label attribute

The element declares an empty aria-label, so its accessible name is still missing.

HTML
<div role="button" tabindex="0" aria-label=""></div>

WCAG techniques

Sufficient techniques

Failure techniques

ACT Rules

Try It Yourself

Using a screen reader

New to screen reader testing, or need a refresher?
Review this article first: Practical guides for using screen readers

  1. Load the page, open a screen reader.
  2. Move to the control that you want to inspect.
  3. Listen to what the screen reader announces.

Expected results: It speaks the control's name.

Actual results: It announces the control’s type like “button”, “link” or “menuitem”, but it does not announce its purpose.

Inspecting the browser dev-tools

  1. Open the Accessibility Tree panel.
  2. Select the control on the DOM tree.

Expected results: The Name field shows the text you provided.

Actual results: If unnamed, Name is empty.

FAQ

How does this issue relate to 4.1.2 Name, role, value?

SC 4.1.2 requires every user interface component to have a name that can be programmatically determined. A command element without an accessible name violates this requirement because assistive technologies cannot convey the control's purpose.

Why is this issue marked as Serious?

Without an accessible name, command elements are functionally invisible to screen readers and voice-control software. Users who rely on these technologies cannot activate the control, which blocks critical tasks and makes the interface unusable.

Standards and Regulations

StandardSuccess CriterionReference
WCAG 2.24.1.2 Name, Role, Value (A)For all user interface components, 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 assistive technologies.
EN 301 5499.4.1.2 Name, Role, ValueSame as the WCAG text.
508 Trusted Tester2.4.4-link-purpose, 6.AThe purpose of each link or button can be determined from any combination of the link/button text, accessible name, accessible description, and/or programmatically determined link/button context.

Personas impacted by this issue