VibeFix

Guide · Shopify

Shopify icon button has no name: how to fix it

Published by Yosef Dabian, founder of VibeFix

How this guide was made: Written with AI assistance and checked against the sources linked on this page.

Updated

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. 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).

Check your store's homepage for accessibility issues, free. We open it like any visitor and only read the page.

Check my store free

Free. No email needed. It usually takes about a minute.

Want it fixed? Our AI agent fixes accessibility issues in your Shopify theme's code within 48 hours of you giving us access to your theme, on an unpublished copy you preview and publish yourself. $390 until 30 Nov (Black Friday), then $490 one time. See the store service.

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. 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:

<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:

<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:

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

The cart drawer's Close button, in snippets/cart-drawer.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:

<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:

<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.

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:

<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").

Check your store's homepage for accessibility issues, free. We open it like any visitor and only read the page.

Check my store free

Free. No email needed. It usually takes about a minute.

Want it fixed? Our AI agent fixes accessibility issues in your Shopify theme's code within 48 hours of you giving us access to your theme, on an unpublished copy you preview and publish yourself. $390 until 30 Nov (Black Friday), then $490 one time. See the store service.

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 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 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.

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

Related guides

Sources

Last checked: 26 November 2026.

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

Want it fixed?

Our AI agent fixes accessibility issues in your Shopify theme's code within 48 hours of you giving us access to your theme, on an unpublished copy you preview and publish yourself. $390 until 30 Nov (Black Friday), then $490 one time. See the store service.

It starts with a free check of your public homepage. No email needed.

Check my store free

Shopify Accessibility Watch

Our monthly store-check numbers, one email a month.

We send a confirmation email first. One email a month, unsubscribe in one click. See our privacy notice.

More guides · Shopify store accessibility · About · Your privacy choices