Skip to content
shadcn.io
shadcn.io is not affiliated with official shadcn/ui

Shadcn Skip Nav for React and Tailwind

Lets keyboard users skip to main content.

Skip to content

Main Content

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.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/skip-nav.json

Usage

  • Place SkipNavLink as one of the first focusable elements on the page.
  • Use 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>

API Reference

PropTypeDefault
idstring"skip-nav-content"
classNamestring-
asChildbooleanfalse

SkipNavContent

PropTypeDefault
idstring"skip-nav-content"
classNamestring-
asChildbooleanfalse