Skip to content
ShopifyRule: aria-roles•Reviewed Oct 2026

Use valid WAI-ARIA role values in Shopify themes

The `role` attribute must contain a valid, non-deprecated WAI-ARIA role string.

What's wrong

Misspelled roles like `role="btn"` or `role="nav"` are ignored by assistive tools.

Who it affects

Screen readers treat the element as generic text or a generic container, discarding accessibility semantics.

How to fix on Shopify

Correct typo roles to standard W3C roles such as `button`, `navigation`, `banner`, or `complementary`.

Code example

Problematic Code
LIQUID
<div role="btn" class="cart-button">Cart</div>
Recommended Accessible Code
LIQUID
<button type="button" class="cart-button">Cart</button>
<!-- Or if div is mandatory -->
<div role="button" tabindex="0" class="cart-button">Cart</div>

How to check your fix

Inspect elements with `role` attributes in DevTools. Check against the W3C WAI-ARIA Roles specification.

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)