Basic Usage
Component Structure
For more control, use the component parts:Controlled State
With Custom Trigger
FAQ Pattern
Props Reference
Root Props
Whether the collapsible panel is currently open (controlled)
Whether the collapsible panel is initially open (uncontrolled)
Event handler called when the panel is opened or closed
Whether the component should ignore user interaction
High-Level Props
The component that toggles the collapsible panel
The content to display in the collapsible panel
Panel Props
Whether to keep the element in the DOM while the panel is hidden. Ignored when
hidden_until_found is used.Allows browser’s built-in page search to find and expand the panel contents. Uses
hidden="until-found" to hide the element without removing it from the DOM.Styling
From source code atreflex_ui/components/base/collapsible.py:11-16:
- Root:
flex flex-col justify-center text-secondary-12 - Trigger:
group flex items-center gap-2 - Panel: Smooth height transitions with overflow hidden, animates from 0 to full height
Implementation Details
From source code atreflex_ui/components/base/collapsible.py:30-96:
- High-level API automatically creates root, trigger, and panel components
- Smooth CSS transitions for height changes
- Supports both controlled and uncontrolled state
- Uses CSS custom property
--collapsible-panel-heightfor animations - Accessible keyboard navigation