Skip to content
ShopifyRule: button-name•Reviewed Oct 2026

Provide discernible accessible names for buttons in Shopify

Buttons containing only icons or empty labels leave screen reader users with no indication of their action.

What's wrong

Buttons without text content or accessible labels (such as search triggers, drawer cart toggles, and modal close buttons) are announced simply as 'button'.

Who it affects

Screen reader users cannot determine what the button will do. Voice control users cannot click the button by saying its visible name.

How to fix on Shopify

Add an accessible label to icon-only buttons using `<span class="visually-hidden">{{ 'general.accessibility.close' | t }}</span>` or an `aria-label="{{ 'sections.header.cart' | t }}"` attribute.

Code example

Problematic Code
LIQUID
<button type="button" class="cart-drawer__close">
  {% render 'icon-close' %}
</button>
Recommended Accessible Code
LIQUID
<button type="button" class="cart-drawer__close" aria-label="{{ 'general.accessibility.close' | t }}">
  {% render 'icon-close' %}
  <span class="visually-hidden">{{ 'general.accessibility.close' | t }}</span>
</button>

How to check your fix

Navigate the page using the Tab key with VoiceOver or NVDA active. Ensure that every interactive button announces a clear action like 'Close cart drawer' or 'Submit search'.

Check if your site has this issue

Scan any public store page free against WCAG 2.2 AA in 30 seconds.

Your session has ended

Sign in again to carry on. Anything you typed on this page is kept.

Signed in another way? Use another method (opens a new tab)