How to fix skip link on Headless / Custom (I build in code)

Add a valid, focusable target element (with a matching `id`) for every "Skip to main content" link so keyboard and assistive-technology users can bypass repeated navigation.

Steps for Headless / Custom (I build in code)

  1. In your root layout component (e.g., `_app.jsx`, `layout.tsx`, `App.vue`, `app.html`), add a skip link as the very first rendered element inside `<body>`.
  2. Pass `href="#main-content"` (or your chosen fragment) to the anchor.
  3. In the component that renders your main content area, set `id="main-content"` and `tabindex={-1}` (React/JSX) or `tabindex="-1"` (HTML/Vue/Svelte) on the root element.
  4. Add the visually-hidden-until-focused CSS globally (see snippet below).
  5. For Next.js, place the skip link in `app/layout.tsx` or `pages/_app.tsx`; for Nuxt, use `app.vue` or a global layout file; for SvelteKit, use `src/routes/+layout.svelte`.
  6. Verify with keyboard Tab and a screen reader (NVDA+Firefox or VoiceOver+Safari).
Official Headless / Custom (I build in code) documentation ↗

What is skip link?

A "skip link" is a hidden (but keyboard-focusable) hyperlink that sits at the very top of every page, typically labeled "Skip to main content." When activated, it jumps the user past your navigation menus straight to the page's main content area. For this to work, the link's `href` must point to an element on the same page that actually exists and can receive focus — that element is the "skip link target." When the target is missing or has no matching `id`, the skip link goes nowhere, breaking the shortcut entirely.

Keyboard-only users (people who cannot use a mouse) and screen-reader users must tab through every navigation link on every page load if no working skip link exists — on a store with 20 nav items, that means 20 extra keystrokes to reach the first product. This is a WCAG 2.1 Level A failure (Success Criterion 2.4.1 — Bypass Blocks), meaning it exposes your store to accessibility complaints, lawsuits (ADA Title III in the US, EAA in the EU, AODA in Canada), and poor audit scores. Fixing it is a quick-win code change that immediately improves usability for millions of people who rely on keyboard navigation, and signals technical quality to accessibility auditors and automated scanners alike.

See the complete Skip link guide for every platform and the full background.

Not sure if your Headless / Custom (I build in code) store has this?

Run a free SEOLZ scan — we’ll find skip link and every other issue across your whole site.

Scan my site free

Fix skip link on another platform