Skip to content

Accordion with Icons

Dark Bootstrap 6 accordion with spaced glass cards, colored leading icon tiles, subtitles and limit pills, built on native details with no JavaScript.

Also known as: icon accordion cards, dark accordion, glass accordion, details accordion no javascript

Bootstrap 6 Accordions Responsive Dark #accordion #collapse #dark #icons #responsive

Accordion with Icons live demo

Open in new tab

Bootstrap 6 code (HTML, CSS)

A dark Bootstrap 6 accordion where every item is a separate glass card with a colored icon tile, a title with a subtitle, and a small limit pill. The example lists the benefits of a travel insurance plan. The same pattern fits plan features, service lists, onboarding steps or support topics. It needs no JavaScript.

How it works

The list is .accordion.accordion-gap.awi-accordion. accordion-gap is a Bootstrap 6 modifier that turns the joined accordion into spaced, individually rounded cards. Each item is a native <details class="accordion-item awi-item"> with a shared name="awi-cover", so opening one benefit closes the others. The first item has open and shows expanded on load.

Inside each <summary class="accordion-header"> sit four parts in a flex row: the .awi-icon tile with a Bootstrap Icon, the .awi-text block (.awi-title and .awi-sub), the .awi-limit pill and the chevron svg.accordion-icon, which Bootstrap rotates when the item opens.

Colors come from one variable per item. Classes such as .awi-item--cyan or .awi-item--pink set --awi-tone. The icon tile, pill, check marks, open border and glow mix that tone with color-mix(). When an item opens, its icon tile fills with the solid tone, so the open item is easy to spot. The body is indented to line up with the title.

Bootstrap animates the opening through ::details-content and skips the animation for visitors who prefer reduced motion.

Customization

  • Add a tone: create .awi-item--violet { --awi-tone: #a78bfa; } and put the class on a <details>.
  • --awi-bg, --awi-card and --awi-card-open on .awi-root: change the page color and the closed and open card fills.
  • --bs-accordion-gap on .awi-accordion: widens or tightens the space between cards (0.75rem here).
  • --bs-accordion-border-radius on .awi-accordion: makes the cards rounder or squarer.
  • Remove name="awi-cover" from all items to let several cards stay open together.
  • Delete the .awi-limit span when you do not need a value on the right. The pill is hidden below 576 px anyway.
  • Swap any bi-* icon class inside .awi-icon for your own icon or an inline SVG.

Use cases

  • Feature and plan overviews: colored icon tiles and subtitles introduce each section
  • Pricing and limits pages: limit pills show quotas inside each accordion card
  • Dark landing pages: spaced glass cards give the accordion a modern look
  • Lightweight pages: native details elements work with no JavaScript

Accessibility

Each header is a native <summary>, so it is in the tab order, toggles with Enter or Space and reports its expanded state to screen readers with no ARIA. The icons and the chevron are aria-hidden, so the title and subtitle are read as the button name. Keyboard focus shows an outline in the item's tone. Muted text stays above WCAG AA contrast on the dark cards, and the card color transition turns off under prefers-reduced-motion.

Bootstrap 6 notes

Bootstrap 5 needed accordion-button, accordion-collapse and the Collapse plugin. Bootstrap 6 uses <details>/<summary> with accordion-header and accordion-body. A shared name replaces data-bs-parent, and the new accordion-gap modifier gives the spaced card layout. Custom colors go through --bs-accordion-* variables such as --bs-accordion-btn-bg and --bs-accordion-active-bg. data-bs-theme="dark" on the root keeps it dark in both color modes. Built on Bootstrap 6.0.0-alpha.1, so APIs may still change. Icons come from Bootstrap Icons.

Accordion with Icons at a glance

Framework
Bootstrap 6
Code
HTML, CSS
JavaScript
Only Bootstrap 6's own script
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Accordions
License
Free for personal and commercial use

Questions about this template

Can I use the Accordion with Icons code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear and add the CSS to your stylesheet. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. Only Bootstrap 6's own JavaScript is used, and the download already includes it.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Accordion with Icons – free Bootstrap 6 accordion template
Accordion with Icons · free Bootstrap 6 accordion template

More Accordions

Horizontal Image Accordion – free Pure CSS accordion template

Horizontal Image Accordion

Row of five photo panels that expand horizontally on hover, focus or tap, with vertical titles, smooth @property transitions and a stacked mobile layout.

FAQ Accordion – free Bootstrap 6 accordion template

FAQ Accordion

Bootstrap 6 FAQ section with a native details accordion (first answer open, one at a time), a live question search and FAQPage schema markup.

Accordion with details and summary – free Pure CSS accordion template

Accordion with details and summary

No-JavaScript FAQ accordion built on native details and summary elements with smooth height animation and one-open-at-a-time behavior.

Accordion with Icons – free Bootstrap 5 accordion template

Accordion with Icons

Bootstrap 5 FAQ accordion with leading icon tiles, subtitles, rounded cards, a rotating plus icon and a warm accent color.

Plus/Minus Accordion – free Tailwind CSS accordion template

Plus/Minus Accordion

Tailwind CSS accordion with a rotating plus/minus icon, smooth height animation, keyboard navigation and a switch for single-open or multi-open mode.