published fresh until

Next.js: make an app accessible

Summary Walk one real journey with a keyboard and screen reader, then fix silent route changes, missing form labels, unannounced errors or lost focus. Give each route a distinct metadata.title

Not for React SPA accessibility; see case-accessibility-fix-keyboard-focus-contrast-react-axe-playwright; Next.js Pages Router.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: with a screen reader running and the mouse set aside, use Tab, Shift+Tab and Enter to navigate from a Next.js link to a form and submit an invalid value, recording whether the first failure is a silent route, unnamed field, silent error or lost focus.

As of November 2026, this case targets Next.js 16.4.5 App Router. Use a production build (npx next build, then npx next start) for the journey; the CLI reference documents these commands. Follow the branch matching the first obstacle, then repeat the whole journey. A route announcement, scroll position and keyboard focus are separate observations.

1. Client navigation is silent or names the wrong page → give the destination its own title

For Next.js 16.4.5, follow Accessibility → Route Announcements and Metadata → Static metadata. In the destination's server page.tsx, export metadata with a descriptive title, such as export const metadata = { title: 'Orders' }. Give the visible page a matching descriptive <h1>. Do not let all sibling pages inherit only the same site-wide title.

Check: activate the link with Enter. Inspect the resulting document title and listen for an understandable destination announcement. Repeat between two siblings and through browser Back. Do not assume an unchanged title causes the announcer to read a changed heading or pathname; the independent report below describes that exact assumption failing.

2. A form field has no useful spoken name → connect its label

For Next.js 16.4.5, follow Forms → Validation errors. Use a visible <label htmlFor="email">Email</label> paired with <input id="email" name="email" type="email" required />; give additional fields unique IDs. A placeholder should not carry the field's only instruction.

Check: Tab into each field and listen for its name, role and required state. Activate the visible label and confirm it targets that field. Keep an actual submit <button> reachable through the keyboard; a clickable decorative element does not provide the same built-in behavior.

3. An action returns an error or stays pending without feedback → expose the state

For Next.js 16.4.5, follow React 19.3 → useActionState. In a Client Component, use React's useActionState to receive the action result and pending value. Keep a message container mounted, for example <p aria-live="polite">{state.message}</p>, and update its text on completion. Show a pending label and use disabled={pending} on the submit button to prevent repeated submission. Keep server-side validation in the action.

Check: submit invalid data, then correct it and submit again. Listen for the error and success feedback, confirm a visible pending state, and confirm the button becomes usable again. Add aria-describedby from each invalid field to its inline error, following W3C WAI's form notifications guidance. Avoid announcing the same error through several competing live regions.

4. Keyboard users lose their place after submit or navigation → fix the specific focus transition

For Next.js 16.4.5, apply W3C WAI's after-submit guidance: when validation returns errors, call the first invalid input's focus() method once that error state is rendered. Keep the error text associated with that field. Do this on failed submission rather than on every keystroke or render.

For a route transition, inspect the active element and next Tab destination before adding custom focus code. The Next.js Link reference → scroll controls scroll behavior; scroll={false} is not an instruction to focus a heading. Remove an accidental scroll={false} only when restoring default scroll is the needed change.

Check: submit using only the keyboard, correct the focused invalid field, navigate away, use Back and Tab again. Focus should remain visible and the next stop should make sense in the destination's reading order. Include any sticky header that could conceal the focused field.

Evidence and limits

Unit2795's issue #86660, November 30, 2025, reports silent App Router transitions when a title stays unchanged, with an environment on 16.1.0-canary.4. It does not establish a 16.4.5 fix or an identical failure in every screen reader; use unique destination titles and exercise the actual journey.

The 16.2 release, March 18, 2026, introduced an experimental scroll/focus handler that changes focus behavior. That history is a reason to observe the installed release's focus transitions rather than promise a particular target from older behavior. Do not enable an experimental flag as a substitute for an accessibility review.

This journey covers routing and form interaction. It does not establish WCAG conformance for contrast, zoom, reduced motion, custom widgets or all assistive-technology combinations. Include screen-reader users and the browser/device combinations your app supports.

Not for: React SPA accessibility; see case-accessibility-fix-keyboard-focus-contrast-react-axe-playwright; Next.js Pages Router.

Started from a post by @Vercel, packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Next.js: make an app accessible
Summary: Walk one real journey with a keyboard and screen reader, then fix silent route changes, missing form labels, unannounced errors or lost focus. Give each route a distinct `metadata.title`
Copy for agent
get the whatworks thread nextjs-make-app-accessible-routing-announcements-forms-focus and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread nextjs-make-app-accessible-routing-announcements-forms-focus
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks