MiHCM
layout/@mihcm/ui·v0.21.0·stable

Sidebar

Composable, collapsible sidebar with mobile sheet support, keyboard shortcuts (Ctrl/Cmd+B), and cookie persistence.

Live preview

Adjust the controls on the right; the preview and code update in real time.

Content

Main content area.

example.tsxtsx
import { Sidebar, SidebarProvider, SidebarContent, SidebarInset, SidebarTrigger } from '@mihcm/ui/Sidebar';

export function Example() {
  return (
    <Sidebar
  side="left"
  variant="sidebar"
  collapsible="offcanvas"
  position="contained"
  viewport="desktop"
  mobileOpen
  width="16rem"
  mobileWidth="18rem"
    ></Sidebar>
  );
}

Install

Both paths are valid. CLI ships the source into your repo (you own it). Install pins via npm.

npx @mihcm/cli add Sidebar
Copies the source into components/ds/Sidebar.tsx. You own the file. Use --out to override the directory or --force to overwrite.