Skip to content Skip to main content
LSD Framework
Component · keyboard

Skip links

An accessibility primitive that hides until a keyboard user reaches for it. Press Tab on this page — the link above slides into view.

01 · Single target · slides in on focus.lsd-skip
Skip to main content

Click anywhere inside this dashed box, then press Tab. The link slides down from the top edge.

02 · Multi-target list · nav / main / footer.lsd-skip-list

Click the dashed box and press Tab, then arrow through the stack.

03 · Always-visible · for docs & previews.lsd-skip--visible
Skip to main content
04 · Live target · clicking jumps here:target · highlight

Anchor · real-target

When the link above (or the top-of-page skip link) is activated, focus moves here and the ring pulses once. The host page sets tabindex="-1" on the target so screen readers announce the landing zone.

05 · Why this mattersWCAG 2.4.1 · Bypass Blocks

The WCAG rationale

Sighted users scan a page in milliseconds — keyboard and screen-reader users walk the DOM linearly. Without a skip link, a person on a keyboard tabs through the entire nav, every site, on every page visit.

Success Criterion 2.4.1 (Level A) requires a mechanism to bypass blocks of repeated content. A first-in-DOM skip link satisfies it with zero design cost — visually hidden until focus.

What this primitive guarantees:

  • First focusable element in the document order.
  • Slides in from the top edge on focus (no opacity-only trick — focus is visible).
  • Honours prefers-reduced-motion — no slide, no transition.
  • Pairs with tabindex="-1" on the target so focus moves there after activation.
  • Outline ring uses var(--accent) — never removed, never outline: none.

Drop the link as the first child of <body>, point its href at the main content's id, and add tabindex="-1" to the target for clean focus handoff.

06 · Slide direction · from top edgetransform · translate Y

The animation lives in .lsd-skip: translate(-50%, -120%) to translate(-50%, 0) on :focus. Reduce-motion users get an instant reveal with no slide.

tab → focus slide-in activate focus target
View HTML — minimal markup
<!-- First child of <body>, before everything else -->
<a class="lsd-skip" href="#main-content">Skip to main content</a>

<header>...</header>

<main id="main-content" tabindex="-1">
  ...
</main>

<!-- Multi-target list -->
<ul class="lsd-skip-list">
  <li><a class="lsd-skip-list__link" href="#main-nav">Skip to navigation</a></li>
  <li><a class="lsd-skip-list__link" href="#main-content">Skip to main</a></li>
  <li><a class="lsd-skip-list__link" href="#site-footer">Skip to footer</a></li>
</ul>