---
title: Collapsible
description: An interactive component which expands/collapses a panel.
author:
name: imskyleen
url: https://github.com/imskyleen
---
## Installation
## Usage
```tsx
Collapsible Trigger
Collapsible Content
```
## Props
### Animate UI Props
#### CollapsibleContent
## Don't delete from the DOM
The choice made is the same as Radix UI, i.e. to remove the element from the DOM for accessibility and performance reasons. However, this may pose a problem for SEO. If you want your Collapsible content to be taken into account by Google, please **replace the CollapsibleContent component with**:
```tsx title="components/animate-ui/radix-collapsible.tsx"
const CollapsibleContent = React.forwardRef<
React.ElementRef,
CollapsibleContentProps
>(
(
{
className,
children,
transition = { type: 'spring', stiffness: 150, damping: 17 },
...props
},
ref,
) => {
const { isOpen } = useCollapsible();
return (
{children}
);
},
);
```
## Credits
- We use [Radix UI](https://www.radix-ui.com/primitives/docs/components/collapsible) for the collapsible component.
- We take our inspiration from [Shadcn UI](https://ui.shadcn.com/docs/components/collapsible) for the collapsible style.