Collapsible
The Collapsible component lets you expand or collapse content when needed.
Anatomy
A Collapsible consists of the following parts:
CollapsibleTrigger: The button that toggles the collapsible.
CollapsibleContent: The component that contains the collapsible content.
Adding a Collapsible
To add a Collapsible to your page, follow these steps:
Insert the Collapsible component from the Library.
Update the default text in the Collapsible to clearly indicate its function.
Modify the content within the CollapsibleContent as needed.
Guides
Using a Collapsible for Additional Details
Sometimes, you might want to keep an interface clean by hiding extra details until needed. To set up an expandable content section:
Add and select the Collapsible component.
Edit the CollapsibleTrigger text to fit your content.
Add, edit, or remove any text inside the CollapsibleContent as needed.
Creating an Expandable List
If you’re working with a list of items, a Collapsible can help make it more interactive. A common example is a navigation menu with a collapsible section where additional nav items only appear when needed.
To create a collapsible list:
Select the CollapsibleContent inside the Collapsible component.
Place your list items (e.g.,
DropdownMenuItem) inside the CollapsibleContent so they are only visible when expanded.
Animating the Trigger Icon
You can animate the icon inside a CollapsibleTrigger to visually indicate when the section is expanded or collapsed.
To animate the trigger icon:
Select the trigger icon and go to the Properties Panel.
In the Classes input, add the
"animated-icon"class and the"rotate"subclass.Click on the
openstate to view its applied styles.Scroll to the Effects section and find the Transform panel.
Click on Rotate and adjust the Z value (default is
180deg).