Skip to content

React accessibility with WCAG 2.2: a practical guide

What changed in WCAG 2.2, what the law requires and when, and how to handle focus, modals and testing in React. Including a case where axe passes and the criterion fails.

Ramon Gomes 18 min read Level: Intermediate

Also available in: Español, Français, Português

Series Front-end for a news portal Part 6 of 7

In February 2026, WebAIM ran axe on the home page of one million websites. 95.9% had detectable WCAGW3C guidelines that define how to make web content accessible to people with disabilities, with testable criteria at levels A, AA and AAA. failures, with an average of 56.1 errors per page, up from 51 the year before (WebAIM, 2026). And that's only what a robot can see.

Senior front-end job posts ask for "experience with WCAG", and in the interview the conversation usually stops at "I add alt to images". This guide covers what changed in 2.2, what the law requires, how to handle focus, modals and forms in React, and where automation fools you. With three cases of my own, including one where the test passed and the criterion didn't.

What Changed from WCAG 2.1 to 2.2

WCAG 2.2 became a W3C Recommendation on October 5, 2023 and got an editorial update on December 12, 2024, which is the version published today (W3C, 2024). It's backward compatible, and TetraLogical recommends basing every new audit on it (TetraLogical, 2023). There's also an authorized Brazilian Portuguese translation, published on March 27, 2025 under the lead of Ceweb.br (W3C).

List of the nine new WCAG 2.2 criteria with number and level: 2.4.11 Focus Not Obscured (Minimum) AA, 2.4.12 Focus Not Obscured (Enhanced) AAA, 2.4.13 Focus Appearance AAA, 2.5.7 Dragging Movements AA, 2.5.8 Target Size (Minimum) AA, 3.2.6 Consistent Help A, 3.3.7 Redundant Entry A, 3.3.8 Accessible Authentication (Minimum) AA, 3.3.9 Accessible Authentication (Enhanced) AAA
The nine new criteria. The highlighted ones are level A and AA, the ones that count if you're aiming for AA.
Criterion Level What it asks for, in practice
2.4.11 Focus Not Obscured (Minimum) AA The focused element can't disappear entirely behind a sticky header, cookie banner or floating chat
2.5.7 Dragging Movements AA Anything you can do by dragging, you can also do with simple clicks or taps
2.5.8 Target Size (Minimum) AA Targets of at least 24×24 CSS px, or equivalent spacing around them
3.2.6 Consistent Help A If there's a help channel (chat, phone, FAQ), it stays in the same place on every page
3.3.7 Redundant Entry A Don't ask again, in the same process, for what the person already typed
3.3.8 Accessible Authentication (Minimum) AA Login without a cognitive test: allow pasting and password managers

The other three are AAA, including Focus Appearance (2.4.13): if you're aiming for AA, you still have no measurable rule for the focus indicator (TetraLogical, 2023). Do it anyway. Sara Soueidan has a good guide: a 2 px outline, 3:1 contrast and outline with :focus-visible (Soueidan, 2023).

4.1.1 Parsing, which required well-formed HTML, is "obsolete and removed"; if you're bound to WCAG 2.0 or 2.1, you may still have to report on it (W3C, 2024).

WCAG 2.2 became an ISO standard, ISO/IEC 40500:2025 (W3C/WAI). And WCAG 3.0 is a Working Draft dated September 10, 2026, and the W3C says there are "several more years of work" ahead (W3C, 2026). Don't wait for it.

What the Law Requires, and Since When

Where Rule Date
European Union European Accessibility Act, Directive (EU) 2019/882: e-commerce, banking, e-books, transport, telephony Products and services placed on the market after June 28, 2025
European Union EN 301 549 V4.1.1, the technical standard that aligns its web section with WCAG 2.2 A/AA Published on September 2, 2026; presumption of conformity only once cited in the Official Journal of the EU
Brazil Law 13,146/2015 (Brazilian Inclusion Law, LBI), art. 63: websites of companies headquartered or represented in the country, and of government bodies Law of July 6, 2015
Brazil eMAG 3.1, mandatory for the federal government April 2014 version
Brazil ABNT NBR 17225, accessibility for web content and applications, 146 guidelines Launched on March 11, 2025
US ADA Title II, WCAG 2.1 AA for state and local governments April 26, 2027 (population ≥ 50,000) and April 26, 2028 (everyone else)

What changes the answer for your client:

  • EAA. Microenterprises that provide services are exempt: fewer than 10 employees and up to €2 million a year (EUR-Lex, 2019). As of September 2026, EN 301 549 V4.1.1 still hadn't been cited in the Official Journal (DWT, 2026).
  • LBI. Art. 63 requires following "the internationally adopted best practices and accessibility guidelines" (Planalto, 2015). In practice, that points to WCAG.
  • NBR 17225. It covers keyboard, forms, color and captcha (Agência Gov, 2025). But the Brazilian federal government's legislation page doesn't list any 2025 or 2026 decree that makes it mandatory (gov.br). It's a technical reference, not law.
  • ADA. The April 24, 2024 rule had deadlines in 2026 and 2027; an interim rule from April 20, 2026 pushed both back by a year (ADA.gov).

The size of the problem in Brazil: according to the Movimento Web para Todos, fewer than 3% of the country's websites are accessible (Agência Gov, 2025).

Entrance of an old building on a wet sidewalk: a woman, seen from behind, pushes a stroller up a concrete ramp with a peeling painted handrail, while another person walks down the stone steps beside it
The ramp serves the wheelchair, the stroller and the rolling suitcase. Keyboard navigation also helps far more people than the ones who asked for it.

Semantic HTML First, ARIA Second

The W3C's ARIA Authoring Practices Guide opens with "No ARIA is better than Bad ARIA". Its first principle is "a role is a promise": putting role="button" on a div promises the screen reader a button, but gives you no focus, no Enter or Space, and no styling (W3C APG). Keeping the promise is on you.

In the WebAIM Million 2026, 82.7% of pages use ARIA, with more than 133 attributes per page. Pages with ARIA average 59.1 errors; pages without it, 42 (WebAIM, 2026). That's correlation, not causation, but the message is clear.

And the most common failures are the cheapest to fix: low contrast (83.9% of pages), images without alt (53.1%), unlabeled form fields (51%), empty links (46.3%), empty buttons (30.6%) and missing document language (13.5%). None of them needs a library.

In React: htmlFor instead of for, aria-* attributes the same as in HTML, useId to connect label and control, and tabIndex only with 0 or -1 (React). React's "Accessibility" page only exists in the old docs, for version 18.2 (legacy.reactjs.org).

tsx
function EmailField({ error }: { error?: string }) {
  const id = useId();
  return (
    <div>
      <label htmlFor={id}>Email</label>
      <input
        id={id}
        type="email"
        autoComplete="email"
        aria-invalid={error ? true : undefined}
        aria-describedby={error ? `${id}-error` : undefined}
      />
      {error && <p id={`${id}-error`}>{error}</p>}
    </div>
  );
}

autoComplete lets the browser and password manager fill things in, which helps with 3.3.7 and 3.3.8. And the Understanding document for 3.3.8 is blunt: blocking paste in the password or verification code field fails it (W3C). After a submission with errors, the W3C forms tutorial suggests moving focus to the first invalid field (W3C WAI, 2022).

Focus in a SPA: Route Changes and Modals

In a SPA, the content changes and focus stays where it was, sometimes on a link that no longer exists.

Next.js solves half of it: it has a built-in route announcer that reads document.title, then the <h1>, and finally the URL path (Next.js). Announcing isn't moving focus. When Marcy Sutton tested routing with disabled users, the best experience was moving focus to the heading of the new page; jumping back to the top was worse, and announcing alone didn't help people using magnification or voice control (Gatsby, 2019). Headings are also the natural path for screen reader users: in WebAIM's 2024 survey, with 1,539 responses, 71.6% said that on a long page the first thing they do is navigate by headings (WebAIM, 2024). Skipping from <h2> to <h4> or using a styled <div> as a heading breaks that shortcut.

tsx
'use client';
import { usePathname } from 'next/navigation';
import { useEffect, useRef } from 'react';

export function FocusOnRouteChange() {
  const pathname = usePathname();
  const first = useRef(true);
  useEffect(() => {
    if (first.current) { first.current = false; return; }
    const heading = document.querySelector<HTMLElement>('main h1');
    if (!heading) return;
    heading.tabIndex = -1; // focusable by script, outside the Tab order
    heading.focus();
  }, [pathname]);
  return null;
}

For modals, stop writing focus traps by hand. <dialog> has been Baseline since March 2022: showModal() makes the rest of the page inert, and Esc closes it (MDN). Scott O'Hara wrote in 2023 that it's time to swap hand-rolled dialogs for it (O'Hara, 2023).

tsx
function ConfirmDelete({ open, onClose, onDelete }: Props) {
  const ref = useRef<HTMLDialogElement>(null);
  const titleId = useId();
  useEffect(() => {
    const d = ref.current;
    if (open && !d?.open) d?.showModal();
    if (!open && d?.open) d.close();
  }, [open]);
  return (
    <dialog ref={ref} aria-labelledby={titleId} onClose={onClose}>
      <h2 id={titleId}>Delete contact?</h2>
      <p>This action can't be undone.</p>
      <button autoFocus onClick={onClose}>Cancel</button>
      <button onClick={onDelete}>Delete</button>
    </dialog>
  );
}

MDN's rules: a visible close button, autofocus on the right control (here, Cancel) and no tabindex on the dialog. The closedby attribute isn't Baseline yet.

When <dialog> doesn't fit, inert (Baseline since April 2023) takes a chunk of the page out of clicks, focus and the accessibility tree (MDN). The visual dimming is up to you.

In this site's tool catalog, the details panel remembers who opened it, focuses the close button, closes on Esc and traps Tab by hand (ToolDetailSidebar.tsx, lines 103 to 132). It works and passes axe, but it's 30 lines that <dialog> does on its own, and each one is a place to get it wrong. It's a candidate to become a <dialog>.

Targets, Dragging and Motion

24 px targets (2.5.8). The AA minimum is 24×24 CSS px. There are exceptions: a smaller target passes if a 24 px circle centered on it doesn't touch another target, if there's another control with the same function, if it's inline in text, if it's a native browser control, or if the size is essential (W3C). The 44×44 figure comes from 2.5.5 Target Size (Enhanced), level AAA; a 2022 Hand Talk post mentions 44 pixels because it came out before the final version (Hand Talk, 2022).

Dragging (2.5.7). The Understanding document says a keyboard equivalent for a drag does not automatically satisfy the criterion: there has to be a way to do it with a single pointer, by clicking or tapping (W3C). Someone with a tremor who uses a mouse gains nothing from Alt plus arrow.

Motion. Respect prefers-reduced-motion in CSS and in JavaScript. On this site, the animated background on the home page turns off with that preference. Playwright gotcha: reducedMotion has to go inside contextOptions; as a loose key under use it's silently ignored (playwright.config.ts, lines 31 to 34).

css
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
Brushed steel elevator button panel with raised braille dots next to each button; a finger touches the dots beside one of them
The braille next to the button changes nothing for sighted people and everything for people who can't see. A good `aria-label` works the same way.

Libraries: When Not to Reinvent the Combobox

HTML handles buttons, links, forms and simple modals. Comboboxes, menus, tabs, date pickers and trees have long keyboard specs; that's when you reach for a library.

Library What it gives you What stays with you
React Aria (Adobe) 50+ components, tested with multiple screen readers and devices, 30+ languages Styling; it's the most complete and has the largest API
Radix Primitives Follows the W3C APG and manages focus (AlertDialog focuses Cancel) Labels: its own docs say naming the controls is your job
Ariakit Low-level toolkit for building accessible components More composition on your side
Headless UI (Tailwind Labs) Unstyled, accessible components designed for Tailwind Smaller catalog

In my CRM I went with Radix (the radix-ui 1.6 package). The library delivers the behavior, but an icon button without aria-label is still silent: that's the "empty button" on 30.6% of pages in the WebAIM study.

How to Test: The Accessibility Pyramid

Four-layer accessibility testing pyramid, from bottom to top: JSX linting in the editor, axe in component and E2E tests, keyboard-only navigation, and a real screen reader with NVDA or VoiceOver
The higher you go, the more expensive and the rarer it gets. And the more it catches.

1. Lint. eslint-plugin-jsx-a11y flags an img without alt, invalid ARIA attributes and roles missing required properties while you type. Next.js ships with the plugin enabled (Next.js). Moving rules from the docs into the linter is the topic of front-end patterns for teams.

2. Testing Library by role. The docs say getByRole "should be your top preference for just about everything" (Testing Library). If the test can't find the button by name, the screen reader can't either. Exception: input type="password" has no implicit role, so use getByLabelText there (Testing Library).

tsx
await user.click(screen.getByRole('button', { name: 'Delete contact' }));
expect(screen.getByRole('dialog', { name: 'Delete contact?' })).toBeVisible();

3. Playwright plus axe. Playwright's official example stops at the wcag21aa tags (Playwright). Copied as is, it doesn't run the 2.2 rules. Add wcag22aa:

ts
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';

test('signup with no WCAG 2.2 AA violations', async ({ page }) => {
  await page.goto('/signup');
  const { violations } = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa'])
    .analyze();
  expect(violations).toEqual([]);
});

4. Keyboard and screen reader. Go through the main flow without a mouse. Then NVDA on Windows, or VoiceOver on Mac and iPhone. This is where you find what tools can't see: a reading order that makes no sense, a label that explains nothing, a repeated announcement.

How much does automation catch? axe-core says it finds, on average, 57% of WCAG issues, with zero false positives (Deque). The number comes from Deque's own study, with no open data (Deque). In 2017, GOV.UK built a page with 143 failures and ran several tools against it. The best one found 41%; all of them together, 71%; and 29% weren't caught by any (GOV.UK, 2017). One counts by occurrence, the other by type of failure. And a Lighthouse 100 doesn't change that: the score is a weighted average of the automated audits, without the manual ones (Chrome for Developers). The performance score has the same catch, as I explained in Core Web Vitals and the Lighthouse score. For the bigger picture on testing, see the front-end testing guide.

Three Cases of Mine, What Worked and What's Missing

The CRM: axe almost everywhere, and the criterion that slipped through. In the CRM, an expectAccessible() helper runs axe with wcag2a, wcag2aa, wcag21aa and wcag22aa and fails only on serious or critical violations (e2e/support/a11y.ts, lines 5 to 27). It shows up in 48 of the 49 E2ETest that opens the app in a real browser and replays a user path, from the click to the server response, to check the whole flow works. files, many of them in both themes. The pull request template has the line "Keyboard and screen reader (axe with no serious violations)".

Mid-animation, the measured contrast is that of the blended colors; that's why the helper waits for finite animations to finish before running axe, and ignores spinners and skeletons, which spin forever.

Now the case that teaches the most. The CRM's reorderable checklist (checklist.tsx, lines 47 to 84) has progress in aria-live, a handle with a per-item aria-label and usage description, and moves items with Alt plus up or down arrow. axe passes clean. But reading the Understanding document for 2.5.7, it fails: dragging with the mouse and moving with the keyboard aren't enough; it's missing clickable "move up" and "move down" buttons. An automated tool has no way of knowing there's a drag there without a clickable alternative. Automation doesn't catch everything.

This site: the 2.2 rules that weren't running. Here the axe helper uses wcag2a, wcag2aa, wcag21a and wcag21aa (e2e/helpers.ts, lines 44 to 50). No wcag22aa. The "playwright + axe" job runs against the candidate image before every deploy, but with the 2.1 rules.

ManiVez, a native app. The rule lives in the AGENTS.md that the AI agentsProgram that uses a language model to choose actions, call tools and repeat the loop until a task is done, with little human input. read: every touchable element has a role and a label, 48 dp minimum targets, no disabling font scaling, and every new screen goes into the accessibility test. That test walks through every finished screen with it.each and fails on any touchable element without a role or a name. The comment at the top of the helper says "Doesn't replace testing with TalkBack". The full accessibility PRD was left for later: the automated basics went in, the rest waits for demand.

And the skip link, the "skip to content" on the first Tab? The CRM has one (app-shell.tsx, lines 38 to 43). This site doesn't: it's the next fix, along with the wcag22aa tag.

When to Use What

Pitfalls

Useful tools: WAVE, the WebAIM contrast checker, the A11y Project checklist, Testing Library and Playwright.

Frequently Asked Questions

What changed from WCAG 2.1 to 2.2?

Nine new criteria were added, 6 of them at A or AA: Focus Not Obscured, an alternative to dragging, 24 px targets, Consistent Help, Redundant Entry and Accessible Authentication. 4.1.1 Parsing was removed.

Is my WCAG 2.1 conformant site still valid?

Yes, for 2.1. Version 2.2 is backward compatible, but claiming conformance with it requires the new criteria.

Does WCAG 3 apply yet?

No. It's a Working Draft dated September 10, 2026, and the W3C says there are still several years of work ahead.

Does Brazil's Inclusion Law require private companies to have an accessible website?

Yes. Art. 63 of Law 13,146/2015 covers websites of companies headquartered or with a commercial presence in Brazil, as well as government bodies. NBR 17225, from 2025, is the technical standard, but no decree makes it mandatory.

Does the European Accessibility Act apply to companies outside the EU?

It applies to anyone offering products and services to consumers in the European Union, such as e-commerce, since June 28, 2025. Microenterprises providing services, with fewer than 10 employees and up to €2 million a year, are exempt.

What's the minimum button size under WCAG 2.2?

24×24 CSS px at level AA (2.5.8), with exceptions, such as having enough free space around it. The 44×44 px figure is from 2.5.5, level AAA.

Does a Lighthouse accessibility score of 100 mean the site is accessible?

No. The score is a weighted average of automated audits, and the manual ones are left out.

Should I use React Aria, Radix or the native <dialog>?

For a simple modal, <dialog> with showModal() is enough. For comboboxes, menus, tabs and date pickers, use a library. React Aria is the most complete; with all of them, Radix included, labels are still your responsibility.

References

Source: https://ramongomessilva.com.br/blog/react-accessibility-wcag · Accessed on December 02, 2026

Share Share on LinkedIn Share on X
Cite this article

Ready-made reference, with today as the access date.

ABNT

Brazilian standard (NBR 6023). Use it in theses and academic papers submitted in Brazil.

GOMES, Ramon. React accessibility with WCAG 2.2: a practical guide. Ramon Gomes, 19 nov. 2026. Disponível em: https://ramongomessilva.com.br/blog/react-accessibility-wcag. Acesso em: 2 dez. 2026.

APA

American Psychological Association style. Common in scientific papers and journals, especially in the social, behavioral and health sciences.

Gomes, R. (2026, November 19). React accessibility with WCAG 2.2: a practical guide. Ramon Gomes. https://ramongomessilva.com.br/blog/react-accessibility-wcag

BibTeX

Format for LaTeX users (Overleaf, for example). Paste it into your .bib file or import it into Zotero or Mendeley.

@online{gomes2026reactaccessibilitywcag,
  author = {Gomes, Ramon},
  title = {{React accessibility with WCAG 2.2: a practical guide}},
  organization = {Ramon Gomes},
  year = {2026},
  month = nov,
  date = {2026-11-19},
  url = {https://ramongomessilva.com.br/blog/react-accessibility-wcag},
  urldate = {2026-12-02}
}
Found a mistake?

Wrong fact, broken link, outdated information: tell me and I will fix it.

10 to 2,000 characters. If you can, point to the right source.

Only so I can reply. It never shows on any page of the site.

Written by

Ramon Gomes

Software Engineer

Full stack software engineer. I like taking a messy problem, listening to the people who live with it and shipping something that holds up day to day. These days I split my time between my own products, applied AI and client work.

Available for projects

Need Something Like This Built?

I build websites, systems, apps and AI automations, from design to deploy. Tell me what you need or see what I offer.

Related Articles