Accordion
On this page
On this page
Overview
An accordion is a stacked list of panels which allows users to expand or collapse information when selected. They feature panels that consist of a section text label and a caret icon that collapses or expands to reveal more information.
Edit element properties
import '@rhds/elements/rh-accordion/rh-accordion.js';
<rh-accordion>
<!-- H2 tags will be removed on upgrade, rh-accordion-header will set the correct heading level internally using the header tag that wraps it -->
<h2><rh-accordion-header>Item One</rh-accordion-header></h2>
<rh-accordion-panel>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</rh-accordion-panel>
<h2><rh-accordion-header>Item Two</rh-accordion-header></h2>
<rh-accordion-panel>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</rh-accordion-panel>
<h2><rh-accordion-header>Item Three</rh-accordion-header></h2>
<rh-accordion-panel>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</rh-accordion-panel>
</rh-accordion>
Positions the accent slot content relative to the panel's title. The accent slot contains secondary information such as tags, badges, or other small elements.
inline(default) - Accents appear on the same line as the titlebottom- Accents appear below the title
Usage guidelines
- Use
inlinewhen accents are brief and horizontal space permits for both title and accents - Use
bottomwhen you have multiple accent elements or need more horizontal space for the title text - Accent content represents secondary, supplementary information to the title
If this accordion uses large styles
Color Palette for this accordion.
Sets and reflects the currently expanded accordion 0-based indexes. Use commas to separate multiple indexes.
<rh-accordion expanded-index="1,2">
...
</rh-accordion>
Status
What do these mean?
- Figma library:
-
Ready - RH Elements:
-
Ready - RH Shared Libs:
-
Ready
When to use
- When space is at a premium and content cannot be displayed all at once
- When you need to condense a large amount of related information into sections
- When you need a way for users to read or compare sections of content simultaneously
An accordion with four collapsed panels and one expanded panel
Status checklist
| Property | Status | Meaning |
|---|---|---|
| Figma library |
|
Component is available in the Figma library |
| RH Elements |
|
Component is available in RH Elements |
| RH Shared Libs |
|
Component is available in RH Shared Libs |
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.