Collapse menu
Bootstrap 5 Collapse menu component
Responsive collapse menu built with Bootstrap 5. Create a streamlined, user-friendly navigation with intuitive, responsive collapse menus for better user experience.
Basic example
Click the buttons below to show and hide another element via class changes:
.collapse
hides content.collapsing
is applied during transitions.collapse.show
shows content
You can use a link with the href
attribute, or a button with the
data-mdb-target
attribute. In both cases, the
data-mdb-collapse-init
is required.
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad
squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente
ea proident.
<!-- Buttons trigger collapse -->
<a
class="btn btn-primary mb-3"
data-mdb-collapse-init
data-mdb-ripple-init
href="#collapseExample"
role="button"
aria-expanded="false"
aria-controls="collapseExample"
>
Link with href
</a>
<button
class="btn btn-primary mb-3"
type="button"
data-mdb-collapse-init
data-mdb-ripple-init
data-mdb-target="#collapseExample"
aria-expanded="false"
aria-controls="collapseExample"
>
Button with data-mdb-target
</button>
<!-- Collapsed content -->
<div class="collapse" id="collapseExample">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad
squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt
sapiente ea proident.
</div>
// Initialization for ES Users
import { Collapse, Ripple, initMDB } from 'mdb-ui-kit';
initMDB({ Collapse, Ripple });