Skip to main content
  1. Docs
  2. Components
  3. Type

Skip link

The first focusable element on a page: hidden until focused, it jumps past the navigation to the main content.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<a>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

skip-link.tsx
// From the package: a build keeps only what it uses.
import { SkipLink } from "@qeetrix/react";

// Or from its own path.
import { SkipLink } from "@qeetrix/react/skip-link";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
hrefstring"#main"Where it jumps.
childrenReactNode"Skip to main content"The label; without it, messages.label, then the provider's.
messages{ label }the provider'sThis link's strings.
renderReactElementan <a>A router link.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
skip-link<a>Underlined, on the overlay surface when shown.

04

Its target

Give the main region the id and tabIndex={-1}, so focus lands there and the next Tab goes on from it.

layout.tsx
<SkipLink />
<SiteHeader />
<main id="main" tabIndex={-1}>…</main>
Next — Skip linkAccessibility