lailai0916

Skip Link

Navigation

About

An offscreen "skip to main content" link that becomes visible on keyboard focus so keyboard and screen-reader users can bypass repetitive navigation.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Skip Link to your project and fits it to your theme.

Code

How Skip Link is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import SkipLink from "@/components/ui/skip-link";

export default function SkipLinkDemo() {
  return (
    <div className="relative flex h-screen w-full flex-col bg-background text-foreground">
      <SkipLink>Skip to content</SkipLink>
      <header className="flex items-center justify-between border-b border-border px-6 py-4">
        <span className="text-sm font-semibold">laikit UI</span>
        <nav
          aria-label="Primary"
          className="flex gap-4 text-sm text-muted-foreground"
        >
          <a href="#">Docs</a>
          <a href="#">Components</a>
          <a href="#">GitHub</a>
        </nav>
      </header>
      <main
        id="main-content"
        tabIndex={-1}
        className="flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center"
      >
        <p className="text-sm font-medium">Press Tab, then Enter</p>
        <p className="max-w-sm text-sm text-muted-foreground">
          Tabbing from the top of the page reveals the hidden skip link;
          activating it jumps focus straight here, past the header navigation.
        </p>
      </main>
    </div>
  );
}

Dependencies

More by lailai0916

View all
  • Window Panel

    Window Panel

    6
  • Dialog

    Dialog

    1
  • Window Bar

    Window Bar

  • Tabs

    Tabs

  • Scrollable Data Table

    Scrollable Data Table

  • Site Header

    Site Header

  • Skeleton

    Skeleton

  • Segmented

    Segmented

More in Navigation

View all
  • Sidebar

    Sidebar

    235
  • Navbar with Theme Toggle

    Navbar with Theme Toggle

    43
  • Sidebar

    Sidebar

    339
  • Tabs

    Tabs

    60
  • Numberless Pagination with Text

    Numberless Pagination with Text

    11
  • Oversized 404 Numeral

    Oversized 404 Numeral

    50
  • Footer

    Footer

    446
  • Pagination

    Pagination

    43