---
title: Collapsible
description: An interactive component which expands/collapses a panel.

link:
  doc: https://kobalte.dev/docs/core/components/collapsible
  api: https://kobalte.dev/docs/core/components/collapsible#api-reference
---

<ComponentPreview name="collapsible-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/collapsible-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/collapsible" file=<rootDir>/apps/docs/src/registry/ui/collapsible.tsx

    ```

    ```tsx title="components/ui/collapsible" file=<rootDir>/apps/unocss-playground/src/registry/ui/collapsible.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

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

```tsx
<Collapsible>
  <CollapsibleTrigger />
  <CollapsibleContent />
</Collapsible>
```
