Skip to main content
Beta: Front-End Checklist is currently in beta. Some issues are still being fixed. Thanks for your patience.

Align visible labels with accessible names

The accessible name of a control should contain its visible label text.

Utilities
Quick take
Typical fix time 10 min
  • Visible text should be part of the accessible name (ARIA label)
  • Ensure speech-to-text users can trigger controls by their visible name
  • Maintain consistency between what is seen and what is read by tech
Why it matters: When the visible label doesn't match the accessible name, voice control users may find it impossible to interact with the element by speaking its name.

Rule Details

For users of speech recognition software, the accessible name of a control must contain the text that is visible on the screen. WCAG 2.5.3 Label in Name (opens in new tab) exists specifically so voice users can speak the same words they see.

Code Examples

Correct Implementation

<!-- Visible text is part of the ARIA label -->
<button aria-label="Add item to shopping cart">Add item</button>
 
<!-- Preferred: Just use the visible text -->
<button>Add item</button>

Incorrect Implementation

<!-- Mismatch: Voice user says "Submit", but computer expects "Send" -->
<button aria-label="Send feedback">Submit</button>

Why It Matters

  • Voice Control: Users of software like Dragon NaturallySpeaking or Apple Voice Control trigger actions by speaking the visible label. If the underlying code uses a completely different name, the command will fail.
  • Consistency: Prevents confusion for screen reader users who might be collaborating with sighted users ("Click the 'Submit' button").
  • Cognitive Ease: Maintains a 1:1 relationship between what is seen and how the element is identified.

Best Practices

Start with the visible text: If you must use an aria-label, start it with the exact visible text.

Prefer visible text: Whenever possible, avoid aria-label and rely on the actual text content of the element.

Don't use completely different labels: Never have a visible label like "Save" and an accessible name like "Commit changes".

Exceptions

  • Evaluate the rendered experience before treating a static-code smell as a blocker; interaction timing, browser behavior, and assistive technology output often determine severity.
  • Not every secondary accessibility issue deserves equal weight; prioritize the issue that most directly blocks perception, operation, or understanding.
  • Avoid adding redundant markup or ARIA solely to satisfy a rule when a simpler semantic implementation would eliminate the issue entirely.

Verification

Automated Checks

  • Inspect the browser accessibility tree or accessibility pane for the relevant element, role, or accessible name.
  • Run an automated accessibility checker such as axe or Lighthouse where applicable.

Manual Checks

  • Test the affected UI with keyboard-only navigation and confirm the rule holds in the rendered experience.
  • Re-test one representative user flow with a screen reader if this rule affects a key interaction.

Use with AI

Copy these prompts to use with your AI assistant, or install the MCP server to use directly from Claude, Cursor, or Windsurf.

Check

Verify implementation

Compare the visible text of buttons and links with their 'aria-label' or 'aria-labelledby' attributes to ensure the visible text is included in the accessible name.

Fix

Auto-fix issues

Update the ARIA attribute to include the exact string of the visible label text at the beginning of the accessible name.

Explain

Learn more

Explain how a mismatch between visible labels and accessible names breaks the experience for users of voice recognition software.

Review

Code review

Review the rendered markup and interactive states that affect Align visible labels with accessible names. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.

Sources

References used to support the guidance in this rule.

Further Reading

Tools and supplementary material for exploring the topic in more depth.

axe DevTools
deque.comTool

Rules that often go hand-in-hand with this one.

Use a single label for each form field

Form fields should have exactly one associated <label> element for maximum clarity.

Accessibility
Provide accessible names for select elements

All `<select>` elements must have an associated label or an accessible name to be correctly identified by screen readers.

Accessibility
Associate labels with form controls

Form inputs must have programmatically associated labels.

Accessibility
Provide accessible names for tree items

All elements with role="treeitem" must have a descriptive accessible name so screen reader users can navigate hierarchical tree widgets.

Accessibility

Was this rule helpful?

Your feedback helps improve rule quality. This stays internal for now.

Loading feedback...
0 / 385