Skip to content

Accordion with Icons

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

Also known as: faq accordion with icons, collapsible faq list, expandable question panels, help center accordion

Accordion with Icons live demo

Open in new tab

Bootstrap 5 code (HTML, CSS)

A Bootstrap 5 accordion restyled as a warm FAQ section, with a leading icon tile, a title and a short subtitle in every header, separated rounded cards and a plus icon that turns into a close mark when a panel opens. It fits help centers, product pages, checkout pages and support sections.

How it works

The root section.aci sets the cream background and holds an eyebrow, a serif heading and the .accordion.aci-accordion itself. Each accordion-item contains a h3.accordion-header with an accordion-button. Inside the button, .aci-icon holds a Bootstrap Icon and .aci-label stacks the .aci-title question above the .aci-sub subtitle. The answers live in standard accordion-collapse panels.

There is no custom JavaScript. Opening and closing is handled by Bootstrap's collapse plugin through data-bs-toggle="collapse", data-bs-target and data-bs-parent="#aci-faq", which keeps only one panel open at a time. The styling is done almost entirely through Bootstrap's own accordion custom properties on .aci-accordion: borders are removed, the radius is set from --aci-radius, and --bs-accordion-btn-icon is replaced with an inline SVG plus sign that --bs-accordion-btn-icon-transform rotates by 45 degrees into an "x". The open item gets a terracotta left border and a stronger shadow through :has(.accordion-button:not(.collapsed)), and its .aci-icon switches to a solid accent tile.

Customization

  • --aci-accent and --aci-accent-soft on .aci in style.css: recolor the icon tiles, the eyebrow and the active border.
  • --aci-bg and --aci-card: change the section background and the card color, for example to a gray and white scheme.
  • --aci-radius: set to 0.5rem for tighter corners or 1.5rem for softer cards.
  • Swap the bi-truck, bi-arrow-repeat, bi-credit-card-2-front or bi-shield-lock classes inside .aci-icon for any other Bootstrap Icon.
  • Remove data-bs-parent="#aci-faq" from each accordion-collapse to let several answers stay open at the same time.
  • Delete --bs-accordion-btn-icon-transform: rotate(45deg) to keep a plain plus icon, or replace both icon SVGs to use your own chevron.
  • Remove the .aci-sub span for a compact, single-line header.

Use cases

  • Help centers: every question has a leading icon tile and short subtitle so topics are easy to scan
  • Product pages: separated rounded cards present answers in a warm, friendly style
  • Checkout pages: a plus icon that turns into a close mark shows which panel is open
  • Support sections: collapsed panels keep long answer lists compact until a visitor needs them

Accessibility

Bootstrap keeps aria-expanded on each button in sync, and aria-controls / aria-labelledby connect every header with its panel. Headers use real <button> elements inside h3 headings, so they are reachable with Tab and work with Enter and Space. Icons are aria-hidden because the question text already explains each item. The focus ring uses --bs-accordion-btn-focus-box-shadow in the accent color and is shown on :focus-visible. Transitions on the card border and icon tile are turned off under prefers-reduced-motion: reduce, and Bootstrap's collapse animation follows the same media query.

Usage notes

Requires Bootstrap 5 with its JS bundle (added automatically) and Bootstrap Icons. For several accordions on one page, give each one a unique id and update the matching data-bs-parent, data-bs-target and panel ids. The :has() highlight is ignored in very old browsers; the accordion still works there.

Accordion with Icons at a glance

Framework
Bootstrap 5
Code
HTML, CSS
JavaScript
Only Bootstrap 5's own script
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile
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 5 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 5'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@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/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">
Accordion with Icons – free Bootstrap 5 accordion template
Accordion with Icons · free Bootstrap 5 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.

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.

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.