How to make a Shopify cart drawer accessible
A slide-out cart drawer is a modal dialog, and it needs to behave like one. That means a dialog role with aria-modal="true" and a name, focus that moves into the drawer when it opens and stays there while it is open, Escape to close it, and focus returned to the button that opened it. Inside, every quantity and remove control needs a name that includes the product, and changes to the cart need to be announced. Shopify's free Dawn theme does all of this, so you can compare your theme with it.23
Why cart drawers cause problems
Drawers replaced the separate cart page on many Shopify themes because they keep shoppers on the product. For a mouse user that is smooth. For a keyboard or screen reader user, a badly built drawer can mean:
- the drawer opens, but focus stays on the page behind it, so the next Tab press moves through hidden product links;
- focus escapes from the drawer to the page underneath while it is still covering it;
- there is no way to close it without a mouse;
- when it closes, focus is lost and the user is thrown back to the top of the page;
- the plus, minus and bin buttons are announced as "button" with no name;
- adding an item or changing a quantity updates the subtotal silently.
At checkout time, any one of these can stop a sale.
What Shopify asks of drawers and modals
Shopify's accessibility guidance for themes sets out four rules for drawers and modals:1
- when a drawer or modal opens, focus moves to the element that labels it;
- keyboard navigation stays within the open drawer or modal;
- the Escape key closes it and returns keyboard focus to the element that launched it;
- the role used to identify modals is
dialog.
These match the WAI-ARIA Authoring Practices dialog pattern, which also describes Tab and Shift+Tab wrapping within the dialog and Escape closing it.4 They also satisfy two WCAG requirements: focus must move in an order that preserves meaning,5 and keyboard users must be able to leave any component they can enter.6 Trapping focus inside an open modal is allowed, because Escape and the close button let the user leave.
How Dawn builds its cart drawer
Dawn's drawer is a useful reference because it is Shopify's own theme. Its markup gives the drawer role="dialog", aria-modal="true" and an aria-label with the cart title, and its close buttons have an accessible label.2 Its script closes the drawer on Escape, traps focus inside the drawer when it opens (inside the empty-cart message when the cart is empty), remembers the element that opened it, and returns focus there when it closes.3
<div id="CartDrawer" role="dialog" aria-modal="true" aria-label="Your cart">
<button type="button" aria-label="Close">…</button>
…
</div>If your theme's drawer comes from an app or a page builder, check its markup for the same three attributes, then test the behaviour, which matters more than the markup.
Label every control with the product
A cart line usually has a quantity field, plus and minus buttons and a remove button. With three products in the cart, a screen reader user who hears "minus, button" three times cannot tell which line is which. WCAG 4.1.2 asks that every control has a name that assistive technology can read,8 and 3.3.2 asks for labels when content needs user input.9
- Name the quantity field with the product, for example "Quantity for Linen Shirt". Dawn's quantity inputs use an
aria-labelbuilt from a translated "quantity for" string and the product title.2 - Name the plus and minus buttons with the action and product: "Increase quantity for Linen Shirt".
- Name the remove button the same way: "Remove Linen Shirt".
- If the product image is a link, its alt text or link name should be the product title, not "image".
Announce what changed
When a shopper adds an item from a product page, the drawer may slide open, or a small "Added to cart" notice may appear. When they change a quantity inside the drawer, the line total and subtotal update. WCAG 4.1.3 asks that status messages like these can be presented to assistive technology without receiving focus, which normally means an aria-live region or a role="status" element.7 Shopify's theme guidance says the same for notifications and messages, using aria-live.1 Dawn's cart script updates a cart live region after a change.13
- After a quantity change, announce the new subtotal or a short message such as "Cart updated".
- If a change fails, for example because stock ran out, announce the error and leave focus on the control.
- If adding to cart opens the drawer, moving focus into the drawer is enough on its own; do not also announce the whole drawer.
Focus you can see, and that is not hidden
WCAG 2.4.7 asks for a visible keyboard focus indicator.10 Drawers often sit on top of a dark overlay and use their own colours, so check that the focus outline is visible inside the drawer as well as on the page. WCAG 2.2 also added 2.4.11, Focus Not Obscured (Minimum): when a control receives focus, it must not be entirely hidden by content the author put on top, such as a sticky checkout bar or a free-shipping banner.11 Long carts that scroll under a sticky footer are a common failure.
Size matters too. WCAG 2.2's target size criterion asks for pointer targets of at least 24 by 24 CSS pixels, with some exceptions,12 and Shopify's guidance asks themes for 44 by 44 pixels for primary touch targets, including cart menu buttons, close buttons for modals and quantity controls.1 Tiny plus and minus buttons fail on phones.
A five-minute test
- On a product page, use only the keyboard to add an item to the cart. Does the drawer open with focus inside it?
- Press Tab repeatedly. Does focus stay inside the drawer and wrap back to the start?
- Change a quantity with the keyboard. With a screen reader on, is the new total announced?
- Tab to each button. Does each one say which product it acts on?
- Press Escape. Does the drawer close, with focus back on the cart button you started from?
- On a phone, try the plus, minus and remove buttons with your thumb.
For the checkout step after the drawer, see accessible forms and checkout. For a wider keyboard pass across the store, see how to test your website with only a keyboard, and for the theme as a whole, how to make a Shopify theme accessible. Product pages have their own pitfalls; accessible Shopify variant pickers and colour swatches covers the picker that comes before the cart.
Keep checking after theme and app updates
Cart drawers change often: a theme update, a new upsell app or a free-shipping bar can each break focus handling or add unlabelled buttons. Jralo for Shopify, our app, checks your homepage and up to five linked pages against the WCAG 2.2 A and AA rules that automated testing can check, and keeps a dated record of every check; daily checks are on the paid Site plan.14 Automated checks find many problems but not all, so keep the manual test above in your routine as well. You can install Jralo from the Shopify App Store; it is free to install. Disclosure: Jralo is our own product, made by Misimi Corp.
Questions people ask
Is a cart drawer a modal dialog?
If it covers the page and the rest of the page cannot be used until it closes, yes, and it should behave like one. Shopify's Dawn theme marks its cart drawer as a dialog with aria-modal set to true and an accessible name.
Should focus move into the cart drawer when it opens?
Yes. Shopify's accessibility guidance for themes says that when a drawer or modal opens, focus moves to the element that labels it, keyboard navigation stays inside the drawer, and Escape closes it and returns focus to the launcher.
How should quantity buttons be labelled?
With the action and the product, for example Increase quantity for Linen Shirt, so that a screen reader user knows which line they are changing. A plus sign or an icon alone gives the button no useful name.
Do I need to announce that an item was added to the cart?
Yes. When the page changes without moving focus, WCAG 4.1.3 asks that status messages, such as an item added or a new subtotal, can be announced by assistive technology without receiving focus.
Check your site now
Jralo's free check tests your homepage and up to five pages for accessibility (WCAG 2.2 A and AA) and website QA problems, and tells you which countries' accessibility laws are likely relevant to you. No sign-up.
Run the free checkSources
Every number and legal statement in this post links to one of these sources, read on 27 October 2026.
- Shopify.dev: Accessibility best practices for Shopify themes
- Shopify Dawn theme source: snippets/cart-drawer.liquid
- Shopify Dawn theme source: assets/cart-drawer.js
- W3C WAI-ARIA Authoring Practices Guide: Dialog (Modal) pattern
- W3C: Understanding WCAG 2.2, Success Criterion 2.4.3 Focus Order
- W3C: Understanding WCAG 2.2, Success Criterion 2.1.2 No Keyboard Trap
- W3C: Understanding WCAG 2.2, Success Criterion 4.1.3 Status Messages
- W3C: Understanding WCAG 2.2, Success Criterion 4.1.2 Name, Role, Value
- W3C: Understanding WCAG 2.2, Success Criterion 3.3.2 Labels or Instructions
- W3C: Understanding WCAG 2.2, Success Criterion 2.4.7 Focus Visible
- W3C: Understanding WCAG 2.2, Success Criterion 2.4.11 Focus Not Obscured (Minimum)
- W3C: Understanding WCAG 2.2, Success Criterion 2.5.8 Target Size (Minimum)
- Shopify Dawn theme source: assets/cart.js (cart live region)
- Shopify App Store: Jralo listing
More questions
- Why does heading structure matter for screen reader users?
- Visible focus: why removing outlines hurts, and what WCAG 2.2 asks
- Accessible navigation and mega menus
- Accessible product image galleries, sliders and carousels
- Accessible Shopify variant pickers and colour swatches
- The European Accessibility Act: a step-by-step plan for small online sellers
- ADA Title III and websites in plain English
- What to put in an accessibility statement
- How to make a WooCommerce store accessible
- How to fix accessibility issues without breaking your theme
- How to make a Shopify theme accessible: settings, apps and what to check
- Captions, transcripts and audio description for product and marketing video
- What a screen reader user hears on your product page, and how to fix it
- Accessible forms and checkout: labels, errors and autocomplete
- How to test your website with only a keyboard in 10 minutes
- Colour contrast explained: what WCAG asks and how to fix brand colours
- Why automated accessibility testing finds some problems but not all
- How do I write alt text that actually helps?
- What did WCAG 2.2 add to WCAG 2.1?
- How can I prove my website is monitored for accessibility?
- Does the European Accessibility Act apply to my online store?
- Do accessibility widgets make a website ADA compliant?
- Got an ADA website demand letter? What to do first
- How do I check if my website is accessible? A 15-minute method
- Website accessibility laws by country (2026)