Name the icon buttons that screen readers can't announce

Buttons must have discernible text is the message for axe's button-name rule, and it means a button element has no accessible name, so a screen reader announces a button without saying what it does. It happens when a button holds only an icon, such as a menu toggle, a close X or a carousel arrow: the icon tells sighted visitors what it does, and nothing in the markup tells anyone else. Add visible text, visually hidden text or an aria-label that names the action.

Button markup that fails and passes

MarkupResult
<button></button>Fails, with nothing to announce. Deque's button-name rule lists this and the other failing patterns.
<button><svg> … </svg></button>Fails when the icon has no name of its own. Name the button and hide the SVG with aria-hidden="true".
<button value="Search"> with nothing insideFails. A value attribute labels an input button, as W3C's labels tutorial explains, not a button element.
<button aria-label="">Fails. An empty aria-label gives no name.
<button aria-label="Close menu">Passes. Use it on a button that shows only an icon.
<button>Menu</button>Passes, and it's the best option, because sighted visitors and screen readers get the same word.

How to name an icon button

  • Put the name on the button and hide the icon from screen readers: <button aria-label="Close"> <svg aria-hidden="true"> … </svg> </button>. Visually hidden text inside the button works the same way: a <span class="sr-only"> holding the word Close, with a class like the one in WebAIM's invisible content guide.

  • Name the action, not the picture: Close, Menu, Next slide. The names and descriptions guide says to leave the word button out of the name, since screen readers announce the role on their own.

  • For a toggle, keep the name fixed and change its state. W3C's button pattern says a toggle's label shouldn't change when its state does, and sets aria-pressed instead; a button that shows and hides a menu can set aria-expanded to true or false.

Buttons this rule covers, and ones it leaves to other rules

  • Text hidden from assistive technology

    Words inside aria-hidden or display: none aren't part of the name, so a button whose only text is hidden that way still fails.

  • A title attribute alone

    It passes this rule, but sighted visitors only see a title as a tooltip when they hover a mouse over the button, and W3C calls it a last resort that tends to give a poor name. Put the word inside the button or in an aria-label.

  • Divs and spans acting as buttons

    This rule checks button elements. An element with a button role needs a name just the same, and another rule reports it with the message ARIA commands must have an accessible name.

  • Input buttons

    An input of type button, submit or reset takes its name from its value attribute and has its own rule, input-button-name.

The rule's checks and the messages of its sibling rules are in axe-core's message list. W3C's labels tutorial describes the title tooltip, and its names and descriptions guide lists title as a last resort source for a name.

How to fix an empty button

  1. Find the button from the resultUse the selector to locate it. Check the shared header, menus and dialogs first, since one component can repeat the same empty button on every page.
  2. Name what it doesPick the word a sighted visitor would use for the action, such as Search, Close or Next slide.
  3. Add the nameShow the word if the design has room. Otherwise add an aria-label to the button or visually hidden text inside it, and set aria-hidden on the icon.
  4. Listen with a screen readerTab to the button with a screen reader running. You should hear the action, then the word button, once each.

Frequently asked questions

Should a button use aria-label or visible text?

Visible text when there's room. The naming guide prefers visible text because it's easier to keep accurate. Keep aria-label for icon-only buttons, and when a button shows words, its name has to contain them, as WCAG's Label in Name requires.

Is an empty button a WCAG failure?

Yes. Deque maps button-name to Success Criterion 4.1.2 Name, Role, Value at Level A, and rates its impact as critical.

How common are empty buttons?

WebAIM's 2026 Million report found empty buttons on 30.6% of the top million home pages, the fifth most common failure in its list.