kemiljk

Nav

Navigation

About

An accessible navigation list that renders a real nav landmark with ul/li/a markup and marks the active link via aria-current, needing no client-side JavaScript.

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

Code

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

Usage.tsx

import { Nav, NavLink } from "@/components/ui/nav";

/** hrefs here are illustrative, not real routes — this demo shouldn't
 * actually navigate away from the page it's embedded in. */
function preventDemoNavigation(event: React.MouseEvent) {
  event.preventDefault();
}

export default function NavDemo() {
  return (
    <Nav aria-label="Docs">
      <NavLink href="/" onClick={preventDemoNavigation}>
        Overview
      </NavLink>
      <NavLink
        href="/components/"
        aria-current="page"
        onClick={preventDemoNavigation}
      >
        Components
      </NavLink>
      <NavLink href="/theming" onClick={preventDemoNavigation}>
        Theming
      </NavLink>
      <NavLink href="/changelog" onClick={preventDemoNavigation}>
        Changelog
      </NavLink>
    </Nav>
  );
}

More by kemiljk

View all
  • Switch

    Switch

    9
  • Color Picker

    Color Picker

    6
  • Combobox

    Combobox

    1
  • Resizable

    Resizable

    1
  • Progress

    Progress

  • Navigation Menu

    Navigation Menu

  • Textarea

    Textarea

  • Number Field

    Number Field

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    100
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    295
  • Sidebar

    Sidebar

    422
  • Pagination with Ellipsis

    Pagination with Ellipsis

    25
  • Pagination

    Pagination

    3
  • Tabs

    Tabs

    33
  • Menu

    Menu

    23
  • Breadrcrumb

    Breadrcrumb

    6