Collapsible
A collapsible panel controlled by a button.
Installation
pnpm dlx shadcn@latest add @lumi-ui/collapsible
Basic Usage
import {
Collapsible,
CollapsiblePanel,
CollapsibleTrigger,
} from "@/components/ui/collapsible"<Collapsible>
<CollapsibleTrigger>Can I use this in my project?</CollapsibleTrigger>
<CollapsiblePanel>
Yes. Free to use for personal and commercial projects. No attribution
required.
</CollapsiblePanel>
</Collapsible>Anatomy
<Collapsible>
<CollapsibleTrigger/>
<CollapsiblePanel/>
</Collapsible>Cookbook
Usage with Motion
File Tree
API Reference
CollapsiblePanel
Usage with Motion
Base UI spreads its className (including transition styles) onto
your custom component via the render prop. This causes both CSS and JS
animations to run simultaneously, resulting in janky behavior.
Important
When using render with animation libraries like Motion, you can set
animation="none" to reset default css transitions and prevent conflicts between CSS transitions and JavaScript animations.