Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Web docs
Navigation

SkipLink

Lets keyboard users bypass repeated navigation and move directly to main content.

FrameworksAstro · React · Elements

Registry commandlumen add SkipLink

InteractionNative markup

01

See it and copy it

Framework example

Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.

AstroSame visual contract, native framework API
Skip to component preview

In an application, place the Skip Link first in the root layout. The first Tab reveals it; pressing Enter bypasses repeated navigation and moves focus to the main content.

Framework usage

Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens and ui-* class contract.
astro
---
import { SkipLink } from '@santi020k/lumen-astro'
---

<SkipLink href="#skip-link-demo-target">Skip to component preview</SkipLink>

<section
  aria-labelledby="skip-link-demo-title"
  style="max-width: 32rem; margin-inline: auto;"
>
  <p id="skip-link-demo-title"><strong>An escape hatch for keyboard users</strong></p>
  <p>
    In an application, place the Skip Link first in the root layout. The first Tab reveals it;
    pressing Enter bypasses repeated navigation and moves focus to the main content.
  </p>
  <div
    id="skip-link-demo-target"
    tabindex="-1"
    style="margin-top: 1rem; border: 1px solid hsl(var(--line)); border-radius: 0.75rem; padding: 1rem;"
  >
    <strong>Main content target</strong>
    <p>This is where focus lands after the keyboard user activates the Skip Link.</p>
  </div>
</section>
Edit SkipLink in browser
02

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

API reference

Lumen-specific props and runtime attributes for the Astro primitive. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.

AttributeValuesDefaultDescription
hreffragment URLrequiredTargets the main-content id that receives navigation after repeated controls are bypassed.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.

Web docsFull catalog