---
title: "Collapsible"
description: "A panel that shows and hides its content from a trigger, with an animated height and accessible state. Built on Base UI."
plan: Free
docs: https://ui.edbn.me/docs/components/collapsible
---

# Collapsible

A panel that shows and hides its content from a trigger, with an animated height and accessible state. Built on Base UI.

## Installation

```bash
npx shadcn@4.19.0 add https://ui.edbn.me/r/collapsible.json
```

## Dependencies
- npm: @base-ui/react@^1.8.0, class-variance-authority@^0.7.1, lucide-react@^1.33.0
- edbn: edbn-base

## Usage

```tsx examples/collapsible-basic.tsx
"use client";
import { Button } from "@/components/ui/button";
import {
  Collapsible,
  CollapsibleContent,
  CollapsibleTrigger,
} from "@/components/ui/collapsible";

export default function CollapsibleBasicPreview() {
  return (
    <div className="flex w-full max-w-dialog flex-col gap-4">
      <Collapsible>
        <CollapsibleTrigger render={<Button variant="outline" />}>
          Toggle details
        </CollapsibleTrigger>
        <CollapsibleContent className="mt-3 rounded-panel bg-card p-3">
          Additional project details.
        </CollapsibleContent>
      </Collapsible>
      <Collapsible>
        <CollapsibleTrigger variant="row">Ran 3 checks</CollapsibleTrigger>
        <CollapsibleContent className="ps-2 pt-1 text-muted-foreground">
          Lint, types and unit tests passed.
        </CollapsibleContent>
      </Collapsible>
    </div>
  );
}
```

## Files
- components/ui/collapsible.tsx (92 lines)

## For agents
- Base theme, once per project: npx shadcn@4.19.0 add https://ui.edbn.me/r/edbn-base.json
- MCP server with search, items, examples and source: https://ui.edbn.me/mcp
- Every page and item: https://ui.edbn.me/llms.txt
