Snippets Accordion

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.

Bootstrap 5 No jQuery Mar 2020 2.4K views

<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>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.