The accordion component is a group of Collapse component used to toggle the visibility of content. So, it consists of multiple Collapse component.

A popular use case would be the FAQ section of a website when you can toggle the visibility of answers for each question.

Usage

The accordion component is basically a collection of collapse component with additional group option for each.

This page will only complement the Collapse component, so please check out the Collapse component page for more reference.

First Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.
Second Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.
Third Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.

If you want to open one of the items by default, just set aria-expanded="true" to the toggle element.

First Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.
Second Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.
Third Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.

                            

Examples

Within a Card

This is how it looks inside the card component.

First Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.
Second Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.
Third Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.

                            

Separated Card

This is how it looks when using a separate card component.

First Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.
Second Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.
Third Accordion Item Content. Duis tincidunt massa at ultricies sagittis. Mauris bibendum quis ante et consectetur. Nulla fermentum eleifend dolor, ut congue ipsum consectetur sit amet.

                            

Initializing and API

Since the accordion component uses the Collapse component, you can refer to the Collapse Javascript section.