Buttons have an accessible name

Buttons have labels so screen readers can describe their action.

On this page

Impact

ScanGov impact ratings

About

When a button doesn't have an accessible name, screen readers announce it as "button", making it unusable for users who rely on screen readers. [Learn how to make buttons more accessible](https://dequeuniversity.com/rules/axe/4.10/button-name).

Risks

Screen reader users cannot identify or interact with elements.

Why it's important

Gives screen reader users meaningful descriptions of interactive elements so they can understand and use them.

User stories

As a screen reader user, I want all interactive elements to have clear, descriptive names so that I know what they do.

Code

Failing pattern:

<!-- Fail: icon-only button with no accessible name -->
<button>
  <svg aria-hidden="true">...</svg>
</button>

Passing pattern:

<!-- Pass: aria-label provides accessible name -->
<button aria-label="Close dialog">
  <svg aria-hidden="true">...</svg>
</button>

Error

ScanGov messaging when a site fails a standard:

Failed: Buttons have an accessible name

Guidance

Indicators

On this page