Accordion
Bootstrap 5.3 .accordion patterns: single-open, flush, multi-open, accent, compact, outline, success, badges, disabled items, and rich bodies. Toggle the navbar theme — components use Bootstrap variables and adapt automatically.
Interactive reference
Use standard markup (accordion-item, accordion-header, accordion-button, accordion-collapse) for accessibility: real buttons, aria-expanded, and optional data-bs-parent for exclusive open behavior.
Standard — one panel open
Each .accordion-collapse includes data-bs-parent="#accordionStd" so opening a section closes the others.
bootstrap.bundle.min.js.
data-bs-theme="dark"|"light" on <html>. Bootstrap maps that to CSS variables, so borders, backgrounds, and accordion chrome stay readable in both themes without duplicate markup.
.accordion-body. Keep headings logical: use h3 (or h2) for each .accordion-header to preserve outline order on the page.
Flush — no outer radius
Add .accordion-flush when the accordion sits flush inside a card or modal; side borders are removed per Bootstrap defaults.
Multi-open — omit data-bs-parent
Without a parent id, each collapse is independent — useful for specs, legal clauses, or long reference lists.
data-bs-parent on the collapse regions..accordion-body padding for readable line length; avoid fixed pixel colors so dark mode stays balanced.Accent + icons
Template class .accordion-accent tints the open header; icons use Font Awesome 6 (fas).
bootstrap.bundle.min.js loads after the DOM (or initialize collapse if you bundle differently).--bs-accordion-* variables in your CSS for global changes, or scope variants with a wrapper class like .accordion-accent.<button> toggles (as here) over anchor-only triggers. Pair aria-expanded and aria-controls with stable ids on the collapsible region.All collapsed initially
Every .accordion-collapse omits show; each .accordion-button uses collapsed and aria-expanded="false". Still use data-bs-parent for a single-open group.
Compact .accordion-sm
Bootstrap does not ship a small accordion; this template adds tighter padding and type for sidebars, filters, or dense settings panels.
Outline — spaced items
Wrapper .accordion-outline adds a border per item and keeps collapsed headers visually light; open headers use --bs-secondary-bg so light/dark both work.
Success tint .accordion-success
Same API as .accordion-accent, mapped to Bootstrap’s success tokens (--bs-success-rgb, --bs-success-text-emphasis).
Badges in headers + disabled item
Use a flex row inside the button: title with flex-grow-1, then a .badge. The third item uses a disabled button (no collapse region) per Bootstrap’s pattern.
Rich bodies — nested UI
Bodies can contain alerts, lists, buttons, or forms; use Bootstrap utilities and keep contrast theme-safe (text-bg-*, alert).
- Verify email and enable two-factor authentication.
- Connect your first data source.
- Invite at least one teammate.
Tab moves focus; Enter or Space toggles the focused header when it is a button.