Sidebar

Grouped side navigation for an app, with icons and counts.

import { Sidebar } from '@brand-studio/ui';
import { BookOpen, Flame, LayoutDashboard, Package, Users } from 'lucide-react';

export default function SidebarDemo() {
  return (
    <div style={{ width: 248, height: 380, border: '1px solid var(--bs-line-soft)', borderRadius: 12, overflow: 'hidden' }}>
      <Sidebar
        label="Roastery"
        header={<strong style={{ display: 'block', padding: '4px 10px' }}>Still Roastery</strong>}
        sections={[
          { items: [
            { label: 'Overview', href: '#overview', current: true, icon: <LayoutDashboard /> },
            { label: 'Orders', href: '#orders', badge: 12, icon: <Package /> },
            { label: 'Subscribers', href: '#subscribers', icon: <Users /> },
          ] },
          { label: 'Stock', items: [
            { label: 'Green beans', href: '#beans', badge: 4, icon: <Flame /> },
            { label: 'Roast log', href: '#log', icon: <BookOpen /> },
          ] },
        ]}
        footer={<span style={{ fontSize: 13, color: 'var(--bs-muted)', padding: '0 10px' }}>Signed in as Mai</span>}
      />
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { Sidebar } from '@brand-studio/ui';
<Sidebar
  label="Roastery"
  sections={[
    { items: [{ label: 'Overview', href: '/', current: true }] },
    { label: 'Stock', items: [{ label: 'Green beans', href: '/beans', badge: 4 }] },
  ]}
/>

Accessibility

  • Renders an <aside> holding a labelled <nav>. Each section heading labels its list, so screen readers announce the group.
  • The current link gets aria-current="page". Icons are decorative; counts are read as part of the link.
  • The sidebar fills its parent's width and height. On narrow screens, hide it and pass the same links to Header or Mobile Navigation.

API Reference

PropTypeDefault
sectionsSidebarSection[]–
header?React.ReactNode–
footer?React.ReactNode–
label?string'Sidebar'
className?string''

Still, Deskhand and Hollis are fictional brands. The coffee photographs are original generated artwork. @brand-studio/ui is MIT licensed.