Accordion
An accordion consists of a vertically stacked list of headers, which can be pressed to reveal or hide associated sections of content.
<sl-accordion>
<sl-accordion-item summary="Discovering Dinosaurs: A Prehistoric Adventure">
Embark on a thrilling journey back in time to the age of dinosaurs...
</sl-accordion-item>
<sl-accordion-item summary="Geography Safari: Mapping Our World">
...
</sl-accordion-item>
<sl-accordion-item summary="Journey Through Ancient Civilizations">
...
</sl-accordion-item>
<sl-accordion-item summary="Math Magic - solving Puzzles with numbers">
...
</sl-accordion-item>
</sl-accordion>
When to use
Chunking information and reducing clutter
Reduce cognitive load for users by simplifying the interface. When you have a large amount of content, consider using accordions to hide non-essential information initially. Place detailed content within the accordion panel. Users can press on the accordion title to reveal the hidden information.
When not to use
When most items need to be opened
If users need to open the majority of accordion items, it’s better to reveal all the content instead of hiding some. Accordion components are designed to manage content visibility efficiently. If most items need to be expanded, consider alternative designs that display content upfront.
Anatomy
Item | Name | Description | Optional |
---|---|---|---|
1 | Header | Contains the section title and is control for revealing the panel. | No |
2 | Icon | Indicates if the panel is open or closed. | No |
3 | Panel | The section of content associated with an accordion header. | No |
Figma Options
With these options, you can tweak the appearance of the accordion in Figma. They are available in the Design Panel so you can compose the accordion to exactly fit the user experience need for the use case you are working on.
Item | Options | Description |
---|---|---|
Accordion open | all closed 01 02 03 04 05 06 07 08 09 10 all open | Determines which panel is open. |
Edit mode | boolean | Displays slot components for inserting the content of all panels. |
Show up (up to 01 including 10) | boolean | Determines if the item is visible. |
State (for every visible panel) | default hover active disabled | Determines the state of the item. |
Title (for every visible panel) | value | Displays the title of the item. |