Sidebar Nav

Composable building blocks for sidebar navigation: NavItem for individual links, NavGroup for labelled sections, and SidebarNav as the root container.

import { SidebarNav } from "@aetherstack/patterns"

Installation

terminal
npx aether-ui add nav

Import

import.tsx
import { SidebarNav, NavGroup, NavItem } from "@aetherstack/patterns"

Usage

sidebar-nav.tsx
import { SidebarNav, NavGroup, NavItem } from "@aetherstack/patterns"
import { LayoutDashboard, Users, Settings } from "lucide-react"

<SidebarNav>
  <NavGroup label="Main">
    <NavItem
      href="/dashboard"
      label="Dashboard"
      icon={<LayoutDashboard className="h-4 w-4" />}
      active={pathname === "/dashboard"}
    />
    <NavItem
      href="/team"
      label="Team"
      icon={<Users className="h-4 w-4" />}
      badge={3}
    />
  </NavGroup>

  <NavGroup label="Settings" collapsible>
    <NavItem
      href="/settings"
      label="General"
      icon={<Settings className="h-4 w-4" />}
    />
  </NavGroup>
</SidebarNav>

Props

PropTypeDefaultDescription
NavItem.href*stringLink destination.
NavItem.label*stringLink text.
NavItem.iconReactNodeIcon to the left of the label. Recommended: Lucide icon, h-4 w-4.
NavItem.badgestring | numberCount badge shown on the right.
NavItem.activebooleanHighlights the item as the current page.
NavItem.disabledbooleanMakes the item non-interactive.
NavGroup.labelstringSection heading above the group.
NavGroup.collapsiblebooleanfalseMakes the group toggleable.
NavGroup.defaultCollapsedbooleanfalseWhether the group starts collapsed.

* Required

Accessibility

  • SidebarNav renders as <nav aria-label="Sidebar navigation"> — a landmark region.
  • Active NavItem gets aria-current="page" automatically.
  • Disabled NavItem gets aria-disabled="true" and tabIndex={-1}.
  • Collapsible NavGroup toggles aria-expanded on the heading button.