Lambchop
Layout

SidebarNav

Collapsible sidebar navigation with icons and active states.

import { SidebarNav } from "lambchop";

Live Demo

Usage

import { SidebarNav, type NavItem } from "lambchop";

const items: NavItem[] = [
  { label: "Dashboard", href: "/", icon: <DashboardIcon />, active: true },
  { label: "Revenue", href: "/revenue", icon: <RevenueIcon /> },
  { label: "Writers", href: "/writers", icon: <WritersIcon /> },
];

<SidebarNav
  items={items}
  collapsed={false}
  onToggleCollapse={() => setCollapsed(!collapsed)}
  header={<span>LGM Dashboard</span>}
/>

Props

PropTypeDefaultDescription
itemsNavItem[]Navigation items
collapsedbooleanfalseWhether sidebar is collapsed
onToggleCollapse() => voidToggle collapse callback
headerReact.ReactNodeOptional header slot (logo, title)
classNamestringAdditional CSS classes
FieldTypeDefaultDescription
labelstringNavigation label
hrefstringLink destination
iconReact.ReactNodeOptional icon element
activebooleanfalseWhether this item is active