Sidebar Nav

About this component

Sidebar Nav

Dashboard sidebar with a brand header, grouped nav items, Lucide icons, trailing count badges, and an active state. Collapse is driven from the shell topbar via the `collapsed` prop (icon rail when true).

Usage

The import and the props worth knowing about, in one place.

import { SidebarNav } from "@/components/beste/component/sidebar-nav";
import { LayoutDashboard, Users } from "lucide-react";

// The collapse toggle lives in your topbar; pass `collapsed` down.
<SidebarNav
  brand={{ name: "Acme Inc" }}
  collapsed={collapsed}
  defaultActiveId="dashboard"
  groups={[
    {
      label: "Overview",
      items: [
        { id: "dashboard", label: "Dashboard", icon: LayoutDashboard },
        { id: "customers", label: "Customers", icon: Users, badge: 24 },
      ],
    },
  ]}
  onNavigate={(id) => console.log("navigate:", id)}
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
brand{ name: string; icon?: LucideIcon }—
groups*SidebarNavGroup[]—
activeIdstring—Controlled active item id; omit to let the component track it
defaultActiveIdstring—
onNavigate(id: string) => void—
collapsedboolean—Collapsed (icon-rail) state. The collapse toggle lives in the shell's topbar, not inside the sidebar — pass this from the shell. Falls back to `defaultCollapsed` when omitted.
defaultCollapsedboolean—
classNamestring—

More Dashboard components

View all Dashboard
Actions
A
Amara Okafor[email protected]
ScaleActive$4,820Jan 4, 2026
D
Diego Santos[email protected]
StarterTrial$0Feb 18, 2026
GrowthActive$2,140Nov 22, 2025
T
StarterChurned$380Aug 9, 2025
L
ScaleActive$6,390Mar 2, 2026
M
StarterTrial$0Feb 27, 2026

8 row(s)

Page 1 of 2