docs/components/skip-nav
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
Lets keyboard users skip to main content.
PreviewCode
This is the main content area. When users press Tab and then Enter on the skip link, focus jumps here.
Click on the "Preview" tab and use the tab key to see the skip to content link.
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/skip-nav
SkipNavLink as one of the first focusable elements on the page.SkipNavContent to wrap your main content. It renders a div with an id that the link targets.import { SkipNavContent, SkipNavLink } from "@/components/ui/skip-nav";
<SkipNavLink />
<nav>...</nav>
<SkipNavContent />
<main>Your main content</main>
| Prop | Type | Default |
|---|---|---|
id | string | "skip-nav-content" |
className | string | - |
asChild | boolean | false |
| Prop | Type | Default |
|---|---|---|
id | string | "skip-nav-content" |
className | string | - |
asChild | boolean | false |
[
Previous page
Skeleton ](/docs/components/skeleton)[
Next page
Slider ](/docs/components/slider)
On This Page