Fix button-name in Shopify Liquid
Icon-only search toggles, mobile menu hamburgers, modal close buttons, and cart quantity (+/-) buttons are the #1 critical axe-core failure on Shopify storefronts. Adding localized aria-label attributes (or .visually-hidden text using Liquid | t translation keys) and marking inline SVG icons aria-hidden='true' fixes the defect across every store page.
Before and after
{%- comment -%} sections/header.liquid (Broken icon-only search button) {%- endcomment -%}
<button type="button" class="header__icon header__icon--search" data-open-search>
{%- render 'icon-search' -%}
</button>{%- comment -%} sections/header.liquid (Fixed with localized aria-label + decorative icon) {%- endcomment -%}
<button
type="button"
class="header__icon header__icon--search"
aria-label="{{ 'general.search.search' | t | escape }}"
aria-controls="SearchDrawer-{{ section.id }}"
aria-expanded="false"
data-open-search
>
<span aria-hidden="true">{%- render 'icon-search' -%}</span>
</button>Fixed vs. broken example
Tab to each button and inspect the Accessibility pane in DevTools: the broken control exposes an empty Name while the fixed control exposes "Open site search".
Playwright + axe-core check
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
test("Shopify header & cart icon buttons expose discernible names", async ({ page }) => {
await page.goto("/");
await expect(page.getByRole("button", { name: /search/i })).toBeVisible();
const results = await new AxeBuilder({ page })
.withRules(["button-name"])
.analyze();
expect(results.violations).toEqual([]);
});Template deduplication tip
An unlabeled search or cart icon in sections/header.liquid fires on 100% of your store's URLs. A11yDrift maps every page's header violation into one global layout cluster—fix sections/header.liquid once to eliminate hundreds of raw alerts.
What NVDA and VoiceOver announce
Blind screen-reader users and voice-dictation users (Dragon, Voice Control) encounter unlabeled icon buttons as generic 'button' controls with no clue whether activating them opens search, closes a modal, or deletes an item.
NVDA (Windows)
"button" (silence — no action name announced)
"Open site search, button"
VoiceOver (macOS / iOS)
"button" (unlabeled interactive element)
"Open site search, button"
Common questions
Should I use aria-label or Shopify's visually-hidden span inside Liquid buttons?
Why do Shopify carousel arrows and modal X buttons fail button-name so often?
Why add aria-hidden='true' and focusable='false' to inline SVG icons?
Test a URL for button-name
Enter any public URL for a free WCAG 2.2 AA check—no account or credit card required.
Managing Shopify Liquid client sites? Monitor 15 sites on one flat plan with white-label portals and branded executive PDFs—$1,140/yr ($95/mo billed annually, 24-month rate lock + onboarding) for Founding 10 agencies.