DEVELOPMENT PREVIEWIn development

Sidebar Navigation

Enhanced sidebar navigation with search, filtering, sorting, and grouping capabilities.

Default Sidebar

Basic sidebar with icons and badges.

Snippet
import { SidebarNav } from '@creo-team/buzz-ui/client'
import { Home, Users, Settings } from 'lucide-react'

const items = [
  { key: 'home', label: 'Home', href: '/home', icon: <Home className="h-4 w-4" /> },
  { key: 'users', label: 'Users', href: '/users', icon: <Users className="h-4 w-4" /> },
  { key: 'settings', label: 'Settings', href: '/settings', icon: <Settings className="h-4 w-4" />, badge: 'New' },
]

<SidebarNav
  items={items}
  title="Navigation"
/>

With Search & Alphabetical Sort

Enable search filtering and alphabetical sorting for easier navigation.

Snippet
<SidebarNav
  items={items}
  title="Navigation"
  sortAlphabetically={true}
  showSearch={true}
/>

Grouped Navigation

Group items by category using a custom grouping function.

Snippet
const groupByCategory = (item) => {
  if (['overview', 'analytics'].includes(item.key)) return 'Dashboard'
  if (['team', 'roles'].includes(item.key)) return 'Team'
  return 'Settings'
}

<SidebarNav
  items={items}
  title="Grouped Navigation"
  groupBy={groupByCategory}
  showSearch={true}
/>

API Reference

PropTypeDefaultDescription
itemsSidebarNavItem[]requiredArray of navigation items
titlestring"Navigation"Title displayed at the top
sortAlphabeticallybooleanfalseSort items alphabetically
showSearchbooleantrueShow search/filter input
groupBy(item) => stringundefinedFunction to group items
variant'compact' | 'default' | 'spacious''default'Size variant
stickyHeaderbooleantrueSticky title and search
scrollablebooleanfalseEnable scrolling within the sidebar

Item Structure

Snippet
interface SidebarNavItem {
  key: string           // Unique identifier
  label: string         // Display text
  href: string          // Link destination
  description?: string  // Optional description (shown in spacious variant)
  badge?: string        // Optional badge text
  icon?: ReactNode      // Optional icon component
}