Collapsible
A collapsible panel controlled by a button.
alien-bean-pasta
wild-irish-burrito
horse-battery-staple
Features
- Full keyboard navigation support
- Supports animation via CSS transitions or animations
- Supports custom open and collapsed heights/widths
Installation
typo3 ui:add collapsible
Please copy the files manually from GitHub into your project.
Read more about installing Components and Primitives.
Examples
Default Open
Set the collapsible to be open by default.
alien-bean-pasta
wild-irish-burrito
horse-battery-staple
Disabled
Prevent the collapsible from being toggled.
alien-bean-pasta
wild-irish-burrito
horse-battery-staple
API Reference
The following tables cover the available props of the Fluid Primitives. For a full list of available client side props and methods, see the Zag.js Machine API.
collapsible.root
Provides the collapsible state and wraps the trigger and content. Renders a <div> element.
| Name | Description | Required | Default |
|---|---|---|---|
defaultOpen | booleanThe initial open state of the collapsible when rendered. Use when you don't need to control the open state of the collapsible. | No | false |
disabled | booleanWhether the collapsible is disabled. | No | - |
collapsedHeight | stringThe height of the content when collapsed. | No | - |
collapsedWidth | stringThe width of the content when collapsed. | No | - |
collapsible.trigger
Toggles the collapsible open and closed. Renders a <button> element.
collapsible.indicator
Displays state-specific content inside the trigger. Use state="open" and state="closed". Renders a <span> element.
| Name | Description | Required | Default |
|---|---|---|---|
state | Enum\CollapsibleIndicatorStateThe indicator state to render. | Yes | - |
collapsible.content
Contains the collapsible content region. Renders a <div> element.
Anatomy
<primitives:collapsible.root>
<primitives:collapsible.trigger>
<primitives:collapsible.indicator state="closed" />
<primitives:collapsible.indicator state="open" />
</primitives:collapsible.trigger>
<primitives:collapsible.content />
</primitives:collapsible.root>