Collapse
Toggle the visibility of content across your project with a few classes and our JavaScript plugins.
The collapse JavaScript plugin is used to show and hide content. Buttons or anchors are used as triggers that are mapped to specific elements you toggle. Collapsing an element will animate the height
from its current value to 0
. Given how CSS handles animations, you cannot use padding
on a .collapse
element. Instead, use the class as an independent wrapping element.
Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user activates the relevant trigger.
<p class="d-inline-flex gap-1">
<a class="btn btn-primary text-white" data-bs-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample"> Link with href </a>
<button class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">Button with data-bs-target</button>
</p>
<div class="collapse" id="collapseExample">
<div class="card card-body">Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user activates the relevant trigger.</div>
</div>