---
title: Collapsible
description: An interactive component which expands/collapses a panel.
component: true
featured: true
links:
doc: https://www.radix-ui.com/docs/primitives/components/collapsible
api: https://www.radix-ui.com/docs/primitives/components/collapsible#api-reference
---
## Installation
CLI
Manual
```bash
npx shadcn@latest add collapsible
```
Install the following dependencies:
```bash
npm install @radix-ui/react-collapsible
```
Copy and paste the following code into your project.
Update the import paths to match your project setup.
## Usage
```tsx showLineNumbers
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from "@/components/ui/collapsible"
```
```tsx showLineNumbers
Can I use this in my project?
Yes. Free to use for personal and commercial projects. No attribution
required.
```