# Shopify icon button has no name: how to fix it

Source: https://vibe-fixer.com/guides/shopify-icon-button-no-accessible-name-fix
Last updated: 2026-11-26

## Short answer

A Shopify icon button "has no name" when it shows only a picture, such as a magnifier, a cart or an X, and nothing in the code gives it words. Deque's axe rule `button-name` says: "Buttons must have discernible text that clearly describes the destination, purpose, function, or action for screen reader users." Fix it by adding text the eye does not see (a `visually-hidden` span) or an `aria-label` that names the action, and by hiding the decorative icon with `aria-hidden="true"`. See [The fix](#the-fix). In our study, 61 of 500 stores (12.2%) failed this rule (frame: 500 US Shopify stores drawn from the 3,388 that ran an accessibility widget in HTTP Archive's 1 Nov 2026 crawl, homepage, automated).

## What a screen reader or keyboard user meets

A screen reader user tabbing through the header reaches a button and hears only that it is a button, with nothing to say what it does. Search, cart, menu and close can all sound the same. W3C's success criterion 4.1.2 requires that "the name and role can be programmatically determined" for user interface components, and criterion 1.1.1 requires that, if non-text content is a control, "it has a name that describes its purpose." If you use voice control, test each button: say the name you can see and check that it works.

## How to test it

1. **Free checker.** Run [Shopify accessibility checker](https://vibe-fixer.com/tools/shopify-accessibility-checker). It runs a read-only automated check on your public homepage, and it covers what software can test of WCAG 2.0 and 2.1, Levels A and AA. Button names on the homepage are in scope.
2. **Browser DevTools.** Right-click the icon, choose Inspect, and open the Accessibility tab in the Elements panel. Chrome describes it as the place to view "computed accessibility properties of DOM nodes". A button with no name there has the problem. In the HTML, a button with no text, no `aria-label` and no `aria-labelledby` has no name.
3. **Keyboard Tab.** Tab through the header and the cart drawer. For each icon button, ask: if I could not see this picture, would I know what Enter does? If you use a screen reader (NVDA, VoiceOver or Narrator), listen to what it says at each stop.

## Where to look in your theme

Look for icon buttons in the header, in drawers and in modals. In Shopify's Dawn theme (checked on `main`, commit 779b283, 16 Nov 2026) all of them are named. These show the patterns to copy.

The search button, in `snippets/header-search.liquid`:

```liquid
<summary
  class="header__icon header__icon--search header__icon--summary link focus-inset modal__toggle"
  aria-haspopup="dialog"
  aria-label="{{ 'general.search.search' | t }}"
>
```

The menu button, in `snippets/header-drawer.liquid`:

```liquid
<summary
  class="header__icon header__icon--menu header__icon--summary link focus-inset"
  aria-label="{{ 'sections.header.menu' | t }}"
>
```

The cart link, in `sections/header.liquid`, uses visible-to-screen-reader text instead of an `aria-label`:

```liquid
<span class="visually-hidden">{{ 'templates.cart.cart' | t }}</span>
```

The cart drawer's Close button, in `snippets/cart-drawer.liquid`:

```liquid
<button
  class="drawer__close"
  type="button"
  onclick="this.closest('cart-drawer').close()"
  aria-label="{{ 'accessibility.close' | t }}"
>
```

The newsletter submit arrow in `sections/footer.liquid` has `aria-label="{{ 'newsletter.button_label' | t }}"`. Dawn's English locale file defines these as "Search", "Menu", "Cart", "Close" and "Subscribe".

An unnamed icon button comes from a place where the icon was added by hand: a custom section, a theme that is not Dawn, a code snippet pasted in for a wishlist, compare or quick-view button, a slideshow arrow, an accordion toggle, or a button an app injects. Search your theme files (Online Store, then the horizontal menu, then Edit code; Shopify says to "Duplicate your theme to create a backup copy" first) for `<button` and `<summary`, and check each one that holds an `svg` or an `img` and no words.

## The fix

A button before:

```liquid
<button type="button" class="wishlist-btn">
  <svg viewBox="0 0 20 20"><path d="M10 2l2.4 5 5.6.8-4 3.9 1 5.5-5-2.7-5 2.7 1-5.5-4-3.9 5.6-.8z" /></svg>
</button>
```

**Option 1: visually-hidden text.** This is the pattern Dawn's cart link uses. It works on buttons and on links, and the text can be translated through your theme's locale files:

```liquid
<button type="button" class="wishlist-btn">
  <svg aria-hidden="true" viewBox="0 0 20 20"><path d="M10 2l2.4 5 5.6.8-4 3.9 1 5.5-5-2.7-5 2.7 1-5.5-4-3.9 5.6-.8z" /></svg>
  <span class="visually-hidden">Add to wishlist</span>
</button>
```

The words "Add to wishlist" are an example. If your theme's `locales/en.default.json` has a key for your text, use it with the `t` filter and check the output on the page. Dawn's file has no wishlist key. If your theme does not define `visually-hidden`, copy Dawn's rule from [Shopify form field has no label](https://vibe-fixer.com/guides/shopify-form-field-missing-label-fix).

**Option 2: `aria-label`.** Deque lists a "Non-empty `aria-label` attribute" as one way a button gets its name. This is the pattern Dawn's search, menu and close buttons use:

```liquid
<button type="button" class="wishlist-btn" aria-label="Add to wishlist">
  <svg aria-hidden="true" viewBox="0 0 20 20"><path d="M10 2l2.4 5 5.6.8-4 3.9 1 5.5-5-2.7-5 2.7 1-5.5-4-3.9 5.6-.8z" /></svg>
</button>
```

The words in a name should say what the button does ("Close", "Search", "Add to wishlist"), not what it looks like ("X", "magnifier").

**Hide the decorative icon.** MDN defines it: "The `aria-hidden` state indicates whether the element is exposed to an accessibility API." Put `aria-hidden="true"` on the `svg`, so it does not add noise next to the name. Dawn's icon files, for example `assets/icon-search.svg`, start `<svg fill="none" class="icon icon-search" viewBox="0 0 18 19">` and carry no `aria-hidden`, so any theme that inlines such icons can add it where the icon is rendered. MDN's warning applies: "Do not use `aria-hidden="true"` on focusable elements." Put it on the `svg`, not on the button.

**If the button also shows words**, put the same words in the name. A button that reads "Add to cart" on screen and has `aria-label="Buy"` gives a voice-control user the wrong word to say. Our [108-store guide](https://vibe-fixer.com/guides/shopify-accessibility-mistakes-108-stores) says to "make the accessible name start with, or contain, the visible text."

**A toggle that changes state**, such as a menu button, keeps its name and gets `aria-expanded="false"` or `"true"` that your script updates. Dawn's menu button is a `summary` inside a `details`; check in the DevTools Accessibility tab whether it reports expanded or collapsed.

## How to check it's fixed

1. In DevTools, inspect each icon button. The Accessibility tab shows a name that matches the action.
2. Tab to each button. If you run a screen reader, it speaks the name and "button".
3. Check each language you sell in: a name that is hard-coded in English stays English. Use the theme's translation keys so the name follows the language.
4. Run the [Shopify accessibility checker](https://vibe-fixer.com/tools/shopify-accessibility-checker) again, and check the buttons that are not on the homepage (product page, cart drawer, search modal) by hand.

Every Shopify accessibility guide we publish, and the outside sources we rely on, are listed in the [Shopify accessibility and ADA resource hub](https://vibe-fixer.com/guides/shopify-accessibility-ada-resource-hub).

## FAQ

### Is `aria-label` or visually-hidden text better?

Both are on Deque's list of fixes for `button-name`. Visually-hidden text is page content and can use your theme's locale files; `aria-label` is shorter. Dawn uses both. Test the result in DevTools either way.

### Do I need a name if the button has a `title`?

Use text or `aria-label` instead. Deque's list of ways a button gets its name names inner text, `aria-label`, `aria-labelledby` and `role="presentation"` or `role="none"` (not in tab order). `title` is not on that list, although Deque's passing examples include `<button id="buttonTitle" title="Title"></button>`, so a button with only a `title` may pass the automated check. Check the name in DevTools.

### My icon is an `img` inside the button. What now?

Give the `img` an `alt` that names the action ("Close"), or set `alt=""` on the image and put the name on the button. The button needs a name in one place.

### The button comes from an app. Can I fix it?

If the button is in your theme files, yes. If an app draws it, the markup is in the app's code, so look in the app's settings for a label option, or hide the app's button and add your own named button in the theme.

### Which WCAG criterion is this?

Deque tags `button-name` to 4.1.2 (Name, Role, Value) at Level A. Criterion 1.1.1 also applies where the control is non-text content.

## Want it fixed?

VibeFix's AI agent fixes these issues in your theme's code on an unpublished copy. You preview the copy and publish it yourself, and the AI agent re-checks your live store and gives you a dated before-and-after report.

[Shopify accessibility checker](https://vibe-fixer.com/tools/shopify-accessibility-checker)

## Related guides

- [The 16 accessibility mistakes in 108 Shopify stores](https://vibe-fixer.com/guides/shopify-accessibility-mistakes-108-stores)
- [500 Shopify stores that run an accessibility widget: what the check found](https://vibe-fixer.com/guides/shopify-widget-stores-500-study)
- [How to add alt text in Shopify](https://vibe-fixer.com/guides/how-to-add-alt-text-shopify)

## Sources

- [Deque axe rule: button-name](https://dequeuniversity.com/rules/axe/4.10/button-name)
- [W3C: Understanding 4.1.2 Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html)
- [W3C: Understanding 1.1.1 Non-text Content](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html)
- [MDN: aria-hidden](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden)
- [MDN: aria-label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-label)
- [Shopify Dawn: snippets/header-search.liquid](https://github.com/Shopify/dawn/blob/main/snippets/header-search.liquid)
- [Shopify Dawn: snippets/header-drawer.liquid](https://github.com/Shopify/dawn/blob/main/snippets/header-drawer.liquid)
- [Shopify Dawn: sections/header.liquid](https://github.com/Shopify/dawn/blob/main/sections/header.liquid)
- [Shopify Dawn: snippets/cart-drawer.liquid](https://github.com/Shopify/dawn/blob/main/snippets/cart-drawer.liquid)
- [Shopify Dawn: sections/footer.liquid](https://github.com/Shopify/dawn/blob/main/sections/footer.liquid)
- [Shopify Dawn: assets/base.css](https://github.com/Shopify/dawn/blob/main/assets/base.css)
- [Shopify Dawn: locales/en.default.json](https://github.com/Shopify/dawn/blob/main/locales/en.default.json)
- [Chrome DevTools: Accessibility features reference](https://developer.chrome.com/docs/devtools/accessibility/reference)
- [Shopify Help Center: Edit theme code](https://help.shopify.com/en/manual/online-store/themes/theme-structure/extend/edit-theme-code)

Last checked: 26 November 2026.

VibeFix is independent. Shopify is a trademark of its owner.
