Accordion Bootstrap v50
Accordion Bootstrap v50
View on GitHub
Accordion
Build vertically collapsing accordions in combination with our
Collapse JavaScript plugin.
On this page
How it works
Example
Flush
Always open
Accessibility
Sass
Variables
How it works
The accordion uses collapse internally to make it collapsible. To render an accordion
thatʼs expanded, add the .open class on the .accordion.
Accordion Item #1
This is the first item's accordion body. It is shown by default, until the
collapse plugin adds the appropriate classes that we use to style each element.
These classes control the overall appearance, as well as the showing and hiding
via CSS transitions. You can modify any of this with custom CSS or overriding
our default variables. It's also worth noting that just about any HTML can go
within the .accordion-body, though the transition does limit overflow.
Accordion Item #2
Accordion Item #3
Flush
Add .accordion-flush to remove the default background-color, some borders, and
some rounded corners to render accordions edge-to-edge with their parent container.
Accordion Item #1
Accordion Item #2
Accordion Item #3
Always open
Omit the data-bs-parent attribute on each .accordion-collapse to make accordion
items stay open when another item is opened.
Accordion Item #1
This is the first item's accordion body. It is shown by default, until the
collapse plugin adds the appropriate classes that we use to style each element.
These classes control the overall appearance, as well as the showing and hiding
Accordion Item #2
Accordion Item #3
Accessibility
Please read the collapse accessibility section for more information.
Sass
Variables
$accordion-padding-y: 1rem;
$accordion-padding-x: 1.25rem;
$accordion-color: $body-color;
$accordion-bg: $body-bg;
$accordion-border-width: $border-width;
$accordion-border-color: rgba($black, .125);
$accordion-border-radius: $border-radius;
$accordion-inner-border-radius: subtract($accordion-border-radius,
$accordion-body-padding-y: $accordion-padding-y;
$accordion-body-padding-x: $accordion-padding-x;
$accordion-button-padding-y: $accordion-padding-y;
$accordion-button-padding-x: $accordion-padding-x;
$accordion-button-color: $accordion-color;
$accordion-button-bg: $accordion-bg;
$accordion-transition: $btn-transition, border-radius .15
$accordion-button-active-bg: tint-color($component-active-bg, 90
$accordion-button-active-color: shade-color($primary, 10%);
$accordion-icon-width: 1.25rem;
$accordion-icon-color: $accordion-color;
$accordion-icon-active-color: $accordion-button-active-color;
$accordion-icon-transition: transform .2s ease-in-out;
$accordion-icon-transform: rotate(-180deg);
Currently v5.0.2.
Analytics by Fathom.
Links Guides
Home Getting started
Docs Starter template
Examples Webpack
Themes Parcel
Blog
Swag Store
Projects Community
Bootstrap 5 Issues
Bootstrap 4 Discussions
Icons Corporate sponsors
RFS Open Collective
npm starter Stack Overflow