Skip to content

Sidebar Layout

Collapsible navigation layout components that coordinate desktop and mobile views.


Try Now


Usage

tsx
import { 
  SidebarLayout, 
  Sidebar, 
  SidebarGroup, 
  SidebarItem,
} from "@lablnet/ui";
import { LayoutDashboard, Settings } from "lucide-react";

export default function SidebarDemo() {
  return (
    <SidebarLayout>
      <Sidebar 
        logo={<span>Modula</span>} 
        footer={<div>Admin User</div>}
      >
        <SidebarGroup title="System">
          <SidebarItem icon={<LayoutDashboard className="h-4 w-4" />} active>
            Dashboard
          </SidebarItem>
          <SidebarItem icon={<Settings className="h-4 w-4" />}>
            Settings
          </SidebarItem>
        </SidebarGroup>
      </Sidebar>
    </SidebarLayout>
  );
}

Customization

PropTypeDefaultDescription
logoReact.ReactNode-Branding logo displayed inside header
footerReact.ReactNode-Bottom container content

SidebarItem Props

PropTypeDefaultDescription
iconReact.ReactNode-Leading icon alignments
activebooleanfalseSets active highlight color
hrefstring"#"Navigation anchor URL

CSS Variables

Matches layout card backgrounds and border indicators:

css
:root {
  --background: 0 0% 100%;       /* Outer wrapper background HSL */
  --card: 0 0% 100%;             /* Sidebar container background HSL */
  --border: 220 13% 91%;         /* Divider border outline HSL */
}