Fix link-name in Next.js
Next.js App Router templates commonly wrap a brand <svg> logo or <Image alt='' /> card thumbnail inside <Link href='/'> with no text fallback. Adding aria-label directly onto <Link> (which forwards ARIA attributes to the rendered <a>) gives VoiceOver and NVDA an unmistakable destination name.
Before and after
// app/components/Navbar.tsx (Broken Next.js brand logo <Link> with no accessible name)
import Link from "next/link";
export function Navbar() {
return (
<header>
<Link href="/" className="brand-logo">
<svg width="28" height="28" viewBox="0 0 28 28" fill="currentColor">
<rect width="28" height="28" rx="6" />
</svg>
</Link>
</header>
);
}// app/components/Navbar.tsx (Fixed Next.js <Link> with clear destination label)
import Link from "next/link";
export function Navbar() {
return (
<header>
<Link href="/" aria-label="A11yDrift — Home" className="brand-logo">
<svg aria-hidden="true" focusable="false" width="28" height="28" viewBox="0 0 28 28" fill="currentColor">
<rect width="28" height="28" rx="6" />
</svg>
</Link>
</header>
);
}Fixed vs. broken example
Open the VoiceOver Web Rotor (Control+Option+U) or NVDA Elements List (NVDA+F7) to confirm every icon anchor shows a clear destination label.
Playwright + axe-core check
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
test("Next.js Navbar logo and footer social <Link>s pass link-name", async ({ page }) => {
await page.goto("/");
await expect(page.getByRole("link", { name: "A11yDrift — Home" })).toBeVisible();
const results = await new AxeBuilder({ page })
.withRules(["link-name"])
.analyze();
expect(results.violations).toEqual([]);
});Template deduplication tip
An unlabeled brand logo <Link href='/'> inside app/layout.tsx triggers link-name on every single route of your Next.js app. A11yDrift groups the entire site under one header cluster so one prop addition fixes every page.
What NVDA and VoiceOver announce
Screen-reader users routinely pull up a rotor or links list to jump straight to destinations. Bare icon anchors, empty product-image wrappers, or unlabeled social links appear as meaningless raw URLs or blank entries.
NVDA (Windows)
"link, #social-demo" (raw href fragment read verbatim)
"View A11yDrift on GitHub, link"
VoiceOver (macOS / iOS)
"link" (or raw URL path)
"View A11yDrift on GitHub, link"
Common questions
Does Next.js <Link> forward aria-label directly to the rendered <a> element?
How should I avoid duplicate adjacent links on Next.js blog cards?
Can I add aria-current='page' to active Next.js <Link> items?
Test a URL for link-name
Enter any public URL for a free WCAG 2.2 AA check—no account or credit card required.
Shipping Next.js weekly? Block new link-name regressions in PRs with our baseline-diff GitHub Action PR gate (≤20 URLs/PR).