Components / Page pieces (landing pages, portfolios, docs)
SkipLink
"Skip to content" link for keyboard users: hidden until focused. Put it first in the page.
import { SkipLink } from "@stylhero/ui";
Example
Code
import { SkipLink, Stack, Text } from "@stylhero/ui";
function SkipLinkExample() {
return (
<Stack gap={2}>
<Text variant="small" tone="muted">Press Tab in this box to see it.</Text>
<div style={{ position: "relative", minHeight: 48 }}><SkipLink href="#props" /></div>
</Stack>
);
}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children |
string |
"Skip to content" |
|
className |
string |
- | |
href |
string |
"#content" |
Keyboard
| Key | Does |
|---|---|
| Tab | The first Tab on the page shows it; Enter jumps to the main content |
Accessibility
- Lets keyboard and screen reader users skip the navigation. Put it first in
<body>.
Generated from src/components/SkipLink.tsx. Something wrong or missing? Open an issue.