Collapsibles are helpful for showing and hiding large sections of content as needed.
Attribute | Description | Example Use |
---|---|---|
data-bs-toggle="collapse" |
This attribute is used to turn an element (like a button or link) into a trigger that shows or hides content marked with the .collapse class. |
<button data-bs-toggle="collapse" data-bs-target="#demo">Toggle</button>
|
Collapsible content is hidden by default, but you can display it initially by adding the .show
class
The example below demonstrates a basic accordion built using extended card components.
Apply the data-bs-parent
attribute to ensure that when one collapsible item opens, all others within the specified parent container automatically close.