Sidebar

Playground

Content

Title

Usage

Compose the navigation with SidebarHeader, SidebarContent and SidebarFooter. Put one SidebarTrigger inside SidebarHeader; it provides its own icon. Control collapsed with onCollapsedChange, or set the initial state with defaultCollapsed. Set collapse and expand text with labels. Your app owns links, selection and routing.

'use client';
import {
  Sidebar,
  SidebarHeader,
  SidebarContent,
  SidebarTrigger,
} from '@mbsw/ui';

export default function Example() {
  return (
    <Sidebar
      aria-label={"Project navigation"}
      style={{ height: 200 }}
      labels={{
        collapse: "Collapse sidebar",
        expand: "Expand sidebar",
      }}
    >
      <SidebarHeader
        style={{ minHeight: 'var(--riido-primitive-spacing-spacing-7)' }}
      >
        <span>{"Workspace"}</span>
        <SidebarTrigger />
      </SidebarHeader>
      <SidebarContent>{"Overview"}</SidebarContent>
    </Sidebar>
  );
}

The Playground Code tab includes the full example with your current settings. See Installation for the CSS imports.

Composition