# Collapsible Sidebar 1 - Nested Sidebar Items

> Nested Sidebar Items using shadcn Collapsible for sidebar navigation.

A shadcn/ui block from the [@shadcnblocks](https://shadcnblocks.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnblocks/collapsible-collapsible-sidebar-1).

- Page, with a live preview: https://shadcn.exchange/r/shadcnblocks/collapsible-collapsible-sidebar-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnblocks/collapsible-collapsible-sidebar-1-light-5381fd01810783d6.png
- Registry item: https://shadcnblocks.com/r/collapsible-collapsible-sidebar-1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnblocks.com/r/collapsible-collapsible-sidebar-1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `lucide-react`
- Registry items: `collapsible`

## Files

### `example/collapsible/collapsible-sidebar-1.tsx`

```tsx
import { ChevronRight, Circle } from "lucide-react";

import {
  Collapsible,
  CollapsibleContent,
  CollapsibleTrigger,
} from "@/components/ui/collapsible";

export const title = "Nested Sidebar Items";

const Example = () => (
  <div className="w-full max-w-lg">
    <Collapsible>
      <CollapsibleTrigger className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium hover:bg-muted">
        <ChevronRight className="h-4 w-4" />
        <span>Documentation</span>
      </CollapsibleTrigger>
      <CollapsibleContent className="mt-1 ml-2 border-l-2 pl-2">
        <Collapsible>
          <CollapsibleTrigger className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted">
            <ChevronRight className="h-3 w-3" />
            <span>Components</span>
          </CollapsibleTrigger>
          <CollapsibleContent className="mt-1 ml-4 space-y-1">
            <div className="flex items-center gap-2 px-2 py-1 text-sm hover:bg-muted">
              <Circle className="h-1.5 w-1.5 fill-current" />
              <span>Button</span>
            </div>
            <div className="flex items-center gap-2 px-2 py-1 text-sm hover:bg-muted">
              <Circle className="h-1.5 w-1.5 fill-current" />
              <span>Input</span>
            </div>
          </CollapsibleContent>
        </Collapsible>
      </CollapsibleContent>
    </Collapsible>
  </div>
);

export default Example;
```
