Advertisement

Google Ad Slot: content-top

Bootstrap 5 Collapse

~1 min read · Bootstrap
On this page

The collapse component in Bootstrap 5 is used to show or hide content with a toggle button. It’s often used for menus, sidebars, or accordions.

Basic Collapse:

Toggle a hidden content area with a button.

This is some placeholder content for the collapse component. It's hidden by default and revealed when triggered.
Example
This is some placeholder content for the collapse component. It's hidden by default and revealed when triggered.
Try it yourself

Collapse with Multiple Elements:

Control multiple collapsible elements with different buttons.

First collapsible content.
Second collapsible content.
Example

First collapsible content.
Second collapsible content.
Try it yourself

Accordion (Collapsible Group):

Use the collapse component to create an accordion.

This is the first item's accordion body.

This is the second item's accordion body.
Example

This is the first item's accordion body.

This is the second item's accordion body.
Try it yourself