Cluster 16 · React & Next.js · App Router + JSX-A11y

Next.js App Router WCAG 2.2 AA Compliance Guide (Focus Management, ESLint & Metadata)

Configure Next.js App Router layouts with valid lang attributes, dynamic page titles, skip links, sticky-header scroll-margin-top, and strict eslint-plugin-jsx-a11y rules.

100% Browser-Side · Zero User-Data Upload · Strict CSP

1. Paste Page or Component HTML to Audit

12 WCAG 2.2 AA Checks
Informational Notice: Deterministic DOM/HTML accessibility & EAA Directive 2019/882 engineering linter — pair automated checks with live keyboard Tab & screen-reader testing. Not legal advice.
WCAG 2.2 AA & EAA Static Readiness Score
100 / 100 (A+)
PASS

12/12 checks passing · Low Risk — Ready for Live Screen-Reader & Keyboard QA

WCAG-3.1.1 (SC 3.1.1 (Level A)): Valid document language declared (lang="en") PASS
Primary page language is explicitly declared for screen readers and braille translators.
WCAG-2.4.2 (SC 2.4.2 (Level A)): Descriptive <title> present ("Acme Cloud — Enterprise Control Plane") PASS
Document title announces page context immediately in browser tabs and screen readers.
WCAG-1.4.4 (SC 1.4.4 (Level AA)): Viewport zoom unrestricted (200%+ text scaling supported) PASS
No user-scalable=no or maximum-scale=1 lock detected.
WCAG-1.1.1 (SC 1.1.1 (Level A)): All 1 <img> element(s) carry alt text PASS
Images include explicit alternative text attributes.
WCAG-4.1.2 (SC 4.1.2 (Level A)): All <button> and <a> elements expose accessible names PASS
No unlabelled icon-only controls detected.
WCAG-1.3.1-FORM (SC 1.3.1 / 3.3.2 (Level A)): All form inputs have programmatic <label> or ARIA labels PASS
Zero unlabelled inputs detected.
WCAG-2.4.1 (SC 2.4.1 (Level A)): Skip navigation link and <main> landmark present PASS
Keyboard users can bypass repeated header navigation blocks directly.
WCAG-1.3.1-HEADING (SC 1.3.1 / 2.4.6 (Level AA)): Sequential heading hierarchy verified (h1 → h2) PASS
Screen-reader heading navigation outline is well-ordered.
WCAG-2.1.1 (SC 2.1.1 (Level A)): Zero non-semantic clickable <div>/<span> handlers detected PASS
Interactive actions use keyboard-reachable elements.
WCAG-2.4.4 (SC 2.4.4 (Level A)): Descriptive anchor link labels verified PASS
No ambiguous "click here" or "read more" links without context.
WCAG-1.2.2 (SC 1.2.2 (Level A)): No uncaptioned <video> elements detected PASS
Media captioning baseline clean.
WCAG-2.4.11 (SC 2.4.3 / 2.4.11 (Level AA)): Focus order & visible focus outline checks clean PASS
No positive tabindex overrides or bare outline: none suppression found.
Accessible HTML5 Shell (wcag-2-2-aa-patch.html)
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Acme Cloud — Enterprise Control Plane</title>
  <link rel="stylesheet" href="/wcag-2-2-focus-targets.css" />
</head>
<body>
  <a href="#main-content" class="skip-link">Skip to main content</a>
  <header>
    <nav aria-label="Primary navigation">
      <a href="/"><img src="/logo.svg" alt="Brand home" /></a>
      <button type="button" aria-label="Open navigation menu"><svg aria-hidden="true"></svg></button>
    </nav>
  </header>
  <main id="main-content">
    <h1>Primary Page Heading</h1>
    <section aria-labelledby="section-form">
      <h2 id="section-form">Accessible Form Control</h2>
      <form action="/signup" method="post">
        <label for="work-email">Work email</label>
        <input id="work-email" name="email" type="email" autocomplete="email" required />
        <button type="submit">Continue to Workspace</button>
      </form>
    </section>
  </main>
</body>
</html>
AccessCheck · WCAG 2.2 AA $39 AA Fix Pack

Verify Live WCAG 2.2 AA, Contrast, Landmarks & EU EAA Readiness

Run a full live URL accessibility & EAA readiness audit on AccessCheck (access.runglab.dev), or grab the turnkey $39 AccessCheck AA Fix Pack on Creem (tailored DOM/ARIA patches, focus & target-size CSS, EAA Annex V Accessibility Statement, VPAT 2.5 summary & CI Playwright/axe gate). Need a PayPal invoice? Email [email protected].

WCAG 2.2 AA & EU EAA Technical Control Specification

Control / Criterion Compliant Baseline Engineering & Accessibility Rationale
Root Layout <html lang="en"> + Skip Link Set lang dynamically from locale param in app/[locale]/layout.tsx
Route Titles export const metadata / generateMetadata Satisfies WCAG 2.4.2 Page Titled on every client-side App Router navigation
Focus Not Obscured scroll-margin-top: 88px; :focus-visible Prevents sticky navbars from covering focused elements during Tab/anchor jumps (WCAG 2.4.11)
Lint Gate plugin:jsx-a11y/strict Enforces accessible button, alt, label, and ARIA rules in next lint

Next.js App Router Accessible RootLayout (app/layout.tsx)

app-layout.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: { default: "Acme Cloud", template: "%s | Acme Cloud" }
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        <a href="#main-content" className="skip-link">Skip to main content</a>
        <header><nav aria-label="Primary navigation">{/* nav links */}</nav></header>
        <main id="main-content" tabIndex={-1}>{children}</main>
      </body>
    </html>
  );
}

Strict eslint-plugin-jsx-a11y Config (.eslintrc.json)

eslintrc.a11y.json
{
  "extends": ["next/core-web-vitals", "plugin:jsx-a11y/strict"],
  "rules": {
    "jsx-a11y/anchor-is-valid": "error",
    "jsx-a11y/click-events-have-key-events": "error",
    "jsx-a11y/no-static-element-interactions": "error",
    "jsx-a11y/label-has-associated-control": ["error", { "assert": "either" }]
  }
}

Implementation Steps & Key Insights

  1. Render a valid BCP 47 lang attribute on <html> in RootLayout and localize it per route segment.
  2. Add a visually-hidden-until-focused skip link pointing to <main id="main-content" tabIndex={-1}>.
  3. Set scroll-margin-top equal to sticky header height so WCAG 2.2 SC 2.4.11 Focus Not Obscured never fails.
  4. Upgrade Next.js ESLint config from jsx-a11y recommended to plugin:jsx-a11y/strict.
  • Default create-next-app installs a subset of jsx-a11y rules; enabling plugin:jsx-a11y/strict catches clickable <div> elements and missing form labels early.
  • Client-side <Link> transitions require distinct <title> metadata per page so screen-reader users know navigation succeeded.

Common WCAG & EAA Audit Pitfalls

  • Using <div onClick={...}> for interactive cards instead of native <button> or <Link>.
  • Using next/image without alt props or setting alt="" on informative hero graphics.
  • Allowing sticky <header> bars to overlap focused footer/form links on Shift+Tab.
Verify Live: Audit your live domain on access.runglab.dev or grab the $39 AccessCheck AA Fix Pack. Informational engineering guidance only — not legal advice.

More WCAG 2.2 AA, EU EAA & VPAT Implementation Guides

← Back to WCAG 2.2 AA & EU EAA Hub · AccessCheck Live Audit → · $39 AA Fix Pack → · Cluster 15: GDPR & Consent Mode v2 → · Cluster 12: EU AI Act Art. 50 →

Frequently Asked Questions

Does Next.js handle focus management automatically between routes?

Next.js includes a route announcer for title changes, but moving focus cleanly on modal open/close or multi-step flows still requires explicit refs and semantic <main> landmarks.

Why should <main id="main-content"> include tabIndex={-1}?

Setting tabIndex={-1} allows the skip link and programmatic focus resets to place focus directly on <main> without inserting <main> into the sequential Tab order.

How do I audit my deployed Next.js site for WCAG 2.2 AA?

Paste rendered HTML into the workbench above or run a live URL scan on access.runglab.dev.