Collapsible Sidebar

Sidebar with a toggle button on its edge that collapses it to a narrow rail and expands it again. The button label updates for screen readers.

src/registry/ui/collapsible-sidebar.tsx/r/collapsible-sidebar.json

Installation#

bash
npx shadcn@latest add @minidev/collapsible-sidebar

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/collapsible-sidebar.json

Usage#

tsx
import { CollapsibleSidebar } from "@/components/ui/collapsible-sidebar"

export function Example() {
  return <CollapsibleSidebar />
}

API reference#

CollapsibleSidebar props
PropTypeDefault
children*React.ReactNode-
classNamestring-

* required

Dependencies#

npm

lucide-react

Built from

All navigation components

Learn more