DS0
Patterns

Sidebar Navigation

A vertical navigation sidebar with grouped links, collapsible sections, and active state indication.

Overview

The SidebarNavigation recipe provides a vertical sidebar with grouped navigation links, collapsible sub-items, active state indication, and optional collapsed (icon-only) mode with tooltips.

D
DS0 App

Usage

import { SidebarNavigation } from '@/recipes/sidebar-navigation';

<SidebarNavigation
  groups={[
    {
      label: 'Main',
      items: [
        { label: 'Dashboard', href: '/', icon: <HomeIcon /> },
        { label: 'Analytics', href: '/analytics', icon: <ChartIcon /> },
      ],
    },
    {
      label: 'Settings',
      items: [
        { label: 'General', href: '/settings', icon: <GearIcon /> },
      ],
    },
  ]}
  currentPath="/"
/>

Collapsed Mode

<SidebarNavigation
  groups={groups}
  currentPath="/"
  collapsed={true}
/>

API Reference

PropTypeDefaultDescription
groupsNavGroup[]Navigation groups
currentPathstringCurrently active path
headerReactNodeHeader content (logo, avatar)
footerReactNodeFooter content (logout)
collapsedbooleanfalseCollapsed icon-only mode
classNamestringAdditional CSS classes
interface NavGroup {
  label?: string;
  items: NavItem[];
}

interface NavItem {
  label: string;
  href: string;
  icon?: ReactNode;
  badge?: string | number;
  children?: NavItem[];
  disabled?: boolean;
}

On this page