A Button Without a Name Is Just a Mystery You’re Expected to Click

Otezla website header showing a search icon button highlighted in the navigation bar with no accessible name for screen reader users.
<button aria-label="Search">  <svg aria-hidden="true">...</svg></button>
<button aria-label="Close dialog">  <svg aria-hidden="true">...</svg></button>
<button>  <span class="visually-hidden">Close dialog</span>  <svg aria-hidden="true">...</svg></button>

    Why do icon-only buttons need accessible names?

    Because screen readers cannot interpret icons visually. Without a label, users only hear “button,” with no indication of its function.

    What happens when a button has no accessible name?

    Users must guess its purpose, which can lead to confusion, errors, or inability to complete key actions like closing a dialog or starting a search.

    How do assistive technologies identify buttons?

    They rely on the accessibility tree, which requires a clear name, role, and value. Without a name, the button lacks meaning.

    How can developers fix unlabeled icon buttons?

    Add an aria-label or include visually hidden text inside the button, and mark the icon as decorative using aria-hidden="true".