# Collapsible An interactive component for expanding and collapsing a section of content. ## Use cases - **Suitable**: Product details, settings panels, file trees, and other content that should be shown on demand - **Suitable**: Cases with a lot of content where only a summary needs to be visible by default - **Not suitable**: Cases that need modal interaction or block the page (use `dialog`) - **Not suitable**: Switching between a few tabs or options (use `select` or `radio-group`) ## Usage ```tsx import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@lcui/react" ``` ```tsx Product details This panel can be expanded or collapsed. ``` ## Composition Use the following composition to build a `Collapsible`: ``` Collapsible ├── CollapsibleTrigger └── CollapsibleContent ``` ## Examples ### Basic A summary row with a border and a details panel that show order information. ### Settings panel Use the trigger to reveal additional inputs; `open` can be used for controlled state. ### File tree Nest Collapsible inside folder nodes to build independent tree expansion. ## API Reference ### Collapsible The collapsible root, which holds the open/closed state. ### CollapsibleTrigger The node that toggles the panel. You can also set `data-collapsible-trigger` on any descendant. ### CollapsibleContent The content area of the panel; it does not participate in display while closed. :::note `data-collapsible-trigger` is only used for event binding and does not participate in CSS selectors. To style a node, use a class or the `collapsible:open` / `collapsible:closed` states. :::