Bootstrap 5 UI Tutorial

Build fast, responsive sites with Bootstrap 5

BS5 Collapse

Bootstrap 5 Collapse

The Collapse plugin is used to show and hide large amounts of content.

How it Works

  • Add data-bs-toggle="collapse" to an <a> or a <button>.
  • Add data-bs-target="#id" to connect it to the collapsible element.
  • Add the .collapse class to the element you want to show/hide.

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics