All work

Case study · Accessibility · React

A checkout everyone can finish, in every market

How I kept PerfectDraft's configurable React checkout usable by keyboard and screen reader, whichever loyalty, discount, offer and payment features each market switched on.

Role
Senior Front-End Developer & team lead
Company
PerfectDraft · AB InBev
Stack
React · Magento 2
Tested with
JAWS · Ghost Inspector
One checkout, every combination: five checkout sections, each with its own h2 heading, numbered in keyboard order. Basket is 1, Loyalty and rewards 2, Delivery 3 and Payment 4. Discounts and offers is dashed out as off in this market, and the order skips it.
An illustration of the idea: switch a section off, and the headings and keyboard order still make sense.

The problem

One checkout, many shapes

We rebuilt PerfectDraft's Magento cart and checkout in React. It had to serve every market from one codebase, so features switched on and off per site: different payment methods, loyalty and rewards, discounts and offers.

That meant the checkout never had a single fixed layout. Every combination of sections still had to flow logically, and make sense to someone using a keyboard or a screen reader. A checkout with loyalty, discounts and offers all changing the total is complicated enough to see; it's harder still to hear.

And the stakes are high. If someone can't get through the payment form, you've lost the sale.

What I did

Accessible in every combination

  • Modular sections with real headings

    Every part of the checkout was a self-contained module with its own heading, so screen reader users could jump straight to the section they needed, whichever sections a market had switched on.

  • A logical keyboard order

    Tab order was checked throughout and followed the natural flow of the checkout, so switching a section off never left focus jumping somewhere unexpected.

  • Colour never works alone

    Success, warning and error messages used red, amber and green from the brand, always with a matching icon, so the message type never depended on colour.

  • Contrast within the brand

    PerfectDraft's yellow and black were mostly safe. The odd grey that slipped into text failed contrast checks, and was caught and fixed.

Colour plus an icon, every time: a green success message with a tick, an amber warning with a triangle, and a red error with a cross. The icon carries the meaning too, so nobody has to tell red from green to know what happened.
An illustration of the rule: every message type pairs its colour with an icon.

Why it matters

Who it helps

Pairing colour with an icon helps people with low vision, colourblind people and people who find reading harder, and it still looks good for everyone else. Headings and a predictable keyboard order help anyone who can't, or doesn't want to, use a mouse.

Accessibility is personal for me: a family member lost some of their ability to use a mouse, so I test by keyboard as a matter of habit.

How it was tested

People first, tools second

  1. Step 1: Keyboard checks

    Tab order checked by hand across the checkout, following the flow a customer would take.

  2. Step 2: Screen reader

    Tested with JAWS on Windows, moving through the page by headings as a screen reader user would.

  3. Step 3: QA across devices

    The QA team checked accessibility on a range of other desktop and mobile devices.

  4. Step 4: Automated regression

    Ghost Inspector ran automated tests, with visual checks such as contrast mostly done by eye.

Outcome

Launched with no accessibility issues

The new checkout had a few minor teething problems after launch, as any rebuild does, but none of them were about accessibility.

What I'd do now

More of it automated

Today I'd automate far more of that checking. On my own projects, including this site, axe runs inside the Playwright tests on every build, in light and dark themes, so a contrast slip like that grey is caught before it ships rather than by eye.

  • Accessibility
  • WCAG
  • Screen readers
  • JAWS
  • Keyboard navigation
  • Colour contrast
  • React
  • Checkout
  • Ghost Inspector
Next case study Cutting the image footprint by ~80%

Want a checkout everyone can finish?

hello@robertwood.me