Bootstrap 5 Quote Cards Grid with Accordion
A grid of quote cards where each author bio opens in an accordion, with a switch between grid and list layouts.
<section class="wdw-stage align-items-start">
<div class="container" style="max-width:1040px">
<div class="d-flex flex-wrap align-items-end justify-content-between gap-3 mb-4">
<div>
<span class="wdw-eyebrow">Collection</span>
<h1 class="wdw-heading mb-0">Air Quotes</h1>
</div>
<div class="btn-group" role="group" aria-label="Layout">
<input type="radio" class="btn-check" name="qLayout" id="qGrid" value="grid" checked>
<label class="btn btn-outline-primary rounded-start-pill" for="qGrid">Grid</label>
<input type="radio" class="btn-check" name="qLayout" id="qList" value="list">
<label class="btn btn-outline-primary rounded-end-pill" for="qList">List</label>
</div>
</div>
<div class="row g-4" id="qCards">
<div class="col-md-6 col-lg-4 q-col"><figure class="q-card wdw-aurora h-100 p-4 m-0">
<div class="q-body">
<svg class="q-mark" width="40" height="40" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M10 7H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7zm10 0h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7z"/></svg>
<blockquote class="q-text q-text-lg mb-0">Disappointments are to the soul what a thunderstorm is to the air.</blockquote>
</div>
<div class="q-side">
<figcaption class="d-flex align-items-center gap-3">
<span class="wdw-icon rounded-circle fw-bold small bg-white bg-opacity-25 text-white" aria-hidden="true">JS</span>
<span class="flex-grow-1 min-w-0"><span class="d-block fw-semibold ">Johann Christoph Friedrich von Schiller</span>
<button class="btn btn-link btn-sm p-0 q-about text-white" type="button" data-bs-toggle="collapse" data-bs-target="#qc1" aria-expanded="false" aria-controls="qc1">About the author</button></span>
</figcaption>
<div id="qc1" class="collapse"><p class="small text-white-50 mt-3 mb-0">German playwright, poet and philosopher (1759–1805), a leading voice of Weimar Classicism.</p></div>
</div>
</figure></div>
<div class="col-md-6 col-lg-4 q-col"><figure class="q-card wdw-card h-100 p-4 m-0">
<div class="q-body">
<svg class="q-mark" width="40" height="40" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M10 7H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7zm10 0h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7z"/></svg>
<blockquote class="q-text mb-0">Water, air, and cleanness are the chief articles in my pharmacy.</blockquote>
</div>
<div class="q-side">
<figcaption class="d-flex align-items-center gap-3">
<span class="wdw-icon rounded-circle fw-bold small " aria-hidden="true">NB</span>
<span class="flex-grow-1 min-w-0"><span class="d-block fw-semibold text-body-emphasis">Napoléon Bonaparte</span>
<button class="btn btn-link btn-sm p-0 q-about link-primary" type="button" data-bs-toggle="collapse" data-bs-target="#qc2" aria-expanded="false" aria-controls="qc2">About the author</button></span>
</figcaption>
<div id="qc2" class="collapse"><p class="small wdw-muted mt-3 mb-0">French military leader and emperor (1769–1821) who rose to prominence during the French Revolution.</p></div>
</div>
</figure></div>
<div class="col-md-6 col-lg-4 q-col"><figure class="q-card wdw-card h-100 p-4 m-0">
<div class="q-body">
<svg class="q-mark" width="40" height="40" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M10 7H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7zm10 0h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7z"/></svg>
<blockquote class="q-text mb-0">Only air and light and the love of friends! Let no man lose heart who still has these.</blockquote>
</div>
<div class="q-side">
<figcaption class="d-flex align-items-center gap-3">
<span class="wdw-icon rounded-circle fw-bold small " aria-hidden="true">JG</span>
<span class="flex-grow-1 min-w-0"><span class="d-block fw-semibold text-body-emphasis">Johann Wolfgang von Goethe</span>
<button class="btn btn-link btn-sm p-0 q-about link-primary" type="button" data-bs-toggle="collapse" data-bs-target="#qc3" aria-expanded="false" aria-controls="qc3">About the author</button></span>
</figcaption>
<div id="qc3" class="collapse"><p class="small wdw-muted mt-3 mb-0">German writer and statesman (1749–1832), author of Faust and a towering figure of European literature.</p></div>
</div>
</figure></div>
<div class="col-md-6 col-lg-4 q-col"><figure class="q-card wdw-card h-100 p-4 m-0">
<div class="q-body">
<svg class="q-mark" width="40" height="40" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M10 7H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7zm10 0h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7z"/></svg>
<blockquote class="q-text mb-0">Deserts are full of sand and winds are full of air, both are full of something.</blockquote>
</div>
<div class="q-side">
<figcaption class="d-flex align-items-center gap-3">
<span class="wdw-icon rounded-circle fw-bold small " aria-hidden="true">AB</span>
<span class="flex-grow-1 min-w-0"><span class="d-block fw-semibold text-body-emphasis">Alain Bremond-Torrent</span>
<button class="btn btn-link btn-sm p-0 q-about link-primary" type="button" data-bs-toggle="collapse" data-bs-target="#qc4" aria-expanded="false" aria-controls="qc4">About the author</button></span>
</figcaption>
<div id="qc4" class="collapse"><p class="small wdw-muted mt-3 mb-0">Contemporary author and reflective writer on nature and silence.</p></div>
</div>
</figure></div>
<div class="col-md-6 col-lg-4 q-col"><figure class="q-card wdw-card h-100 p-4 m-0">
<div class="q-body">
<svg class="q-mark" width="40" height="40" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M10 7H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7zm10 0h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7z"/></svg>
<blockquote class="q-text mb-0">What keeps earth air breathable? The earth is a freer place to breathe in.</blockquote>
</div>
<div class="q-side">
<figcaption class="d-flex align-items-center gap-3">
<span class="wdw-icon rounded-circle fw-bold small " aria-hidden="true">KN</span>
<span class="flex-grow-1 min-w-0"><span class="d-block fw-semibold text-body-emphasis">Kathleen Norris</span>
<button class="btn btn-link btn-sm p-0 q-about link-primary" type="button" data-bs-toggle="collapse" data-bs-target="#qc5" aria-expanded="false" aria-controls="qc5">About the author</button></span>
</figcaption>
<div id="qc5" class="collapse"><p class="small wdw-muted mt-3 mb-0">American poet and essayist known for writing on place, solitude and spiritual life.</p></div>
</div>
</figure></div>
<div class="col-md-6 col-lg-4 q-col"><figure class="q-card wdw-card h-100 p-4 m-0">
<div class="q-body">
<svg class="q-mark" width="40" height="40" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M10 7H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7zm10 0h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 1-2 2v2a4 4 0 0 0 4-4V7z"/></svg>
<blockquote class="q-text mb-0">I thought it might be a great thing to be the air. I could be necessary and also invisible.</blockquote>
</div>
<div class="q-side">
<figcaption class="d-flex align-items-center gap-3">
<span class="wdw-icon rounded-circle fw-bold small " aria-hidden="true">BS</span>
<span class="flex-grow-1 min-w-0"><span class="d-block fw-semibold text-body-emphasis">Benjamin Alire Sáenz</span>
<button class="btn btn-link btn-sm p-0 q-about link-primary" type="button" data-bs-toggle="collapse" data-bs-target="#qc6" aria-expanded="false" aria-controls="qc6">About the author</button></span>
</figcaption>
<div id="qc6" class="collapse"><p class="small wdw-muted mt-3 mb-0">American poet and novelist, winner of the Pen/Faulkner Award for fiction.</p></div>
</div>
</figure></div>
</div>
</div>
</section>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.q-card { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; transition: transform .2s ease, box-shadow .2s ease; }
.q-card:hover { transform: translateY(-3px); }
.q-card.wdw-aurora { border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); overflow: hidden; }
.q-mark { color: var(--bs-primary); margin-bottom: .75rem; }
.wdw-aurora .q-mark { color: #fff; }
.q-text { font-size: 1.25rem; font-weight: 700; line-height: 1.45; letter-spacing: -.01em; color: var(--bs-emphasis-color); }
.q-text-lg { font-size: 1.5rem; color: #fff; }
.q-side { border-top: 1px solid var(--bs-border-color); padding-top: 1.25rem; }
.wdw-aurora .q-side { border-color: rgba(255, 255, 255, .25); }
.min-w-0 { min-width: 0; }
.q-about { min-height: 0; font-size: .8125rem; font-weight: 600; text-decoration: none; justify-content: flex-start; }
.q-about:hover { text-decoration: underline; }
.q-about::after { content: ""; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; }
.q-about[aria-expanded="true"]::after { transform: rotate(-135deg); }
#qCards.is-list .q-col { flex: 0 0 100%; width: 100%; max-width: 100%; }
@media (min-width: 768px) {
#qCards.is-list .q-card { flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 2rem; }
#qCards.is-list .q-body { flex: 1 1 auto; }
#qCards.is-list .q-side { flex: 0 0 17rem; border-top: 0; border-left: 1px solid var(--bs-border-color); padding: 0 0 0 1.5rem; }
#qCards.is-list .wdw-aurora .q-side { border-color: rgba(255, 255, 255, .25); }
}
@media (prefers-reduced-motion: reduce) { .q-card, .q-about::after { transition: none; } }
(function () {
function initQuoteLayout() {
var cards = document.getElementById('qCards');
if (!cards) return;
document.querySelectorAll('input[name="qLayout"]').forEach(function (r) {
r.addEventListener('change', function () { cards.classList.toggle('is-list', r.value === 'list' && r.checked); });
});
}
initQuoteLayout();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.