Content
- The words are “Skip to content”.
“Skip to content”: the first keyboard stop on every page, jumping past the navigation.
import { … } from "@brdgapp/ui/components/skip-link"SkipLink is “Skip to content”: the first thing a keyboard user reaches on every page. It's hidden until it has focus, then appears top-left; Enter jumps past the top bar and sidebar to the page itself. Every app adds it once, first in the layout. The usual mistake is a <main> without id="main" and tabIndex={-1}, so the link has nowhere to land.
Keyboard first
Everything works with a keyboard alone, and people can always see where they are: a solid 2px ring on every focus stop, never outline-none without one in its place. Use real buttons and links, never a clickable <div>. Every app starts with SkipLink and has one <main>.
Link. A blue pill, “Skip to content”, top-left above everything (z 100). Off screen until it has focus.
A picture of it over an app's top bar. The real one is on this page: press Tab once.
| State | What happens |
|---|---|
| Hidden | Off screen, still first in the tab order. |
| Focused | Shows top-left with the focus ring. |
#main by default; pass href for another id.tabIndex={-1} so focus can land on it.Do
Put it before the top bar.Don't
Put it after the navigation it's meant to skip.| Keys | Action |
|---|---|
| Tab | First stop on the page: shows the link. |
| Enter | Moves focus to the page's main content. |
SkipLink
Skip to content.
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | "#main" | Where it jumps: the id of the page's <main>. |
className | string | — | Layout only. |
What it's built from and where it's used, read from the code. When you change it, check these too.