Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

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

PropTypeDefaultDescription
children string "Skip to content"
className string -
href string "#content"

Keyboard

KeyDoes
TabThe 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.