- Docs
- Components
- 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
// 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.
| Prop | Type | Default | What it does |
|---|---|---|---|
href | string | "#main" | Where it jumps. |
children | ReactNode | "Skip to main content" | The label; without it, messages.label, then the provider's. |
messages | { label } | the provider's | This link's strings. |
render | ReactElement | an <a> | A router link. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What 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.
<SkipLink />
<SiteHeader />
<main id="main" tabIndex={-1}>…</main>