Skip
Accessibility skip-to-content link that is visually hidden until it receives keyboard focus, letting keyboard users jump past repeated header navigation directly to the main content area. Should be the first focusable element in the DOM.
Usage
When to use
- On every page of a site, as the first focusable element
- When the page has repeated navigation (header, nav, breadcrumb) that keyboard users would otherwise have to tab through on every visit
When not to use
- Inside a component - the skip link is a page-level feature
- As a visible decorative link - it is intentionally hidden until focus
Do
- Point the link at the main landmark (e.g.
#main-content) - Place the link as the first focusable element in the DOM
- Ensure the target has
tabindex="-1"if necessary so focus lands correctly
Don't
- Hide the link with
display: noneorvisibility: hidden- that removes it from keyboard users too - Link to an element that cannot receive focus
API
Slots
| Slot | Required | Description |
|---|---|---|
content | Yes | Visible link text shown when the link receives focus. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
target | string | #main-content | Anchor href pointing to the main content landmark. |
classes | array | - | Additional CSS class words merged into the root element. |
attributes | object | - | Additional HTML attributes spread on the root element. |
Classes
| Class | Capability | Default | Description |
|---|---|---|---|
.sm | Size | - | Small. |
.md | Size | Yes | Medium. |
.lg | Size | - | Large. |
Accessibility
- WCAG 2.2 AA (Success Criterion 2.4.1 Bypass Blocks)
- Keyboard operable and visible on
:focus/:focus-visible - First focusable element in the DOM on every page
- Sufficient color contrast when visible
- Target element is a landmark or container that can receive focus
Related
- header - the skip link typically precedes the header