@objectifthunes/whiteboard
WHITEBOARD DASHBOARD

Sidebar

Grouped dashboard navigation with brand, badge, and footer slots. Framework-agnostic — swap the plain <a> via renderLink.


SOURCE
import { Sidebar, SidebarBrand, activeSidebarHref } from '@objectifthunes/whiteboard'

const groups = [
  { label: 'Catalog', items: [
    { href: '/tracks', name: 'Tracks', icon: <ListMusic size={14} /> },
    { href: '/covers', name: 'Covers', badge: 'PAID' },
  ]},
]

<Sidebar
  brand={<SidebarBrand mark={<Logo />} eyebrow="Acme" name="Admin" meta="v1.0.0" />}
  groups={groups}
  activeHref={activeSidebarHref(groups, pathname)}
  renderLink={(item, props) => <Link {...props} href={item.href} />}
/>
NOTES

By default items render as plain <a> tags. For client-side routing pass renderLink and spread props onto your router's Link: (item, props) => <Link {...props} href={item.href} /> — props carries the computed className (including is-active) and the rendered children.

activeSidebarHref(groups, pathname) picks the longest matching href, so /covers/newactivates "New cover" and not also "Covers". Item icons read best at 14px; badgetakes any node ("PAID", "BETA", a count).