SkipLink
Lets keyboard users bypass repeated navigation and move directly to main content.
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.
An escape hatch for keyboard users
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.
This is where focus lands after the keyboard user activates the Skip Link.
View SkipLink code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.---
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>import type { CSSProperties } from 'react'
import { SkipLink } from '@santi020k/lumen-react'
const exampleStyle0: CSSProperties & Record<`--${string}`, string | number> = { "marginTop": "1rem", "border": "1px solid hsl(var(--line))", "borderRadius": "0.75rem", "padding": "1rem" }
export const Example = () => (
<>
<SkipLink href="#skip-link-demo-target">Skip to component preview</SkipLink>
<section
aria-labelledby="skip-link-demo-title"
style={{ "maxWidth": "32rem", "marginInline": "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={exampleStyle0}
>
<strong>Main content target</strong>
<p>This is where focus lands after the keyboard user activates the Skip Link.</p>
</div>
</section>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-skip-link href="#skip-link-demo-target">Skip to component preview</lumen-skip-link>
<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>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.
pnpm add @santi020k/lumen-astropnpm add @santi020k/lumen-astrolumen add SkipLinklumen add SkipLinkpnpm add @santi020k/lumen-reactpnpm add @santi020k/lumen-reactlumen add SkipLink --target reactlumen add SkipLink --target reactpnpm add @santi020k/lumen-elementspnpm add @santi020k/lumen-elementslumen add SkipLink --target elementslumen add SkipLink --target elementsAPI reference
Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
| Attribute | Values | Default | Description |
|---|---|---|---|
| href | fragment URL | required | Targets the main-content id that receives navigation after repeated controls are bypassed. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |