Expandable
A collapsible container component with smooth animations.
Expandable
A component that provides a collapsible container with smooth animations for showing or hiding content.
Import
Features
- Smooth expand/collapse animations
- Customizable header with title and optional icon
- Controlled or uncontrolled usage
- Custom styling options
Props
Prop | Type | Default | Description |
---|---|---|---|
title | string | — | Text displayed in the header |
titleComponent | ReactNode | — | Custom component to replace the title |
defaultOpen | boolean | false | Initial expanded state (uncontrolled) |
open | boolean | — | Controlled expanded state |
onOpenChange | (open: boolean) => void | — | Callback when expanded state changes |
headerClassName | string | — | Additional classes for header |
contentClassName | string | — | Additional classes for content |
children | ReactNode | — | Content to show when expanded |
headerIcon | IconName | — | Icon to show next to title |