Snippets Accordion

Bootstrap 5 Expanding Image Accordion Gallery

A gallery of photo panels that expands the active one with a smooth zoom while the others collapse into slim strips, switching on hover, focus or tap. On mobile the strips stack vertically.

Bootstrap 5 No jQuery Mar 2020 3.4K views

<section class="wdw-stage">
  <div class="container" style="max-width: 1040px">
    <div class="text-center mb-4">
      <span class="wdw-eyebrow">Gallery</span>
      <h1 class="h2 wdw-heading mt-1 mb-0">Meet the neighbourhood cats</h1>
    </div>
    <ul class="zoom-accordion list-unstyled m-0" aria-label="Cat gallery">
      <li class="zoom-panel is-active">
        <button type="button" class="zoom-btn" aria-expanded="true">
          <img src="https://images.unsplash.com/photo-1514888286974-6c03e2ca1dba?auto=format&fit=crop&w=900&q=70" alt="Plotting Cat" loading="lazy">
          <span class="zoom-caption"><strong>Plotting Cat</strong><small>Always up to something.</small></span>
        </button>
      </li>
      <li class="zoom-panel">
        <button type="button" class="zoom-btn" aria-expanded="false">
          <img src="https://images.unsplash.com/photo-1543852786-1cf6624b9987?auto=format&fit=crop&w=900&q=70" alt="Curious Cat" loading="lazy">
          <span class="zoom-caption"><strong>Curious Cat</strong><small>Needs to inspect everything.</small></span>
        </button>
      </li>
      <li class="zoom-panel">
        <button type="button" class="zoom-btn" aria-expanded="false">
          <img src="https://images.unsplash.com/photo-1592194996308-7b43878e84a6?auto=format&fit=crop&w=900&q=70" alt="Sleepy Cat" loading="lazy">
          <span class="zoom-caption"><strong>Sleepy Cat</strong><small>Naps are non-negotiable.</small></span>
        </button>
      </li>
      <li class="zoom-panel">
        <button type="button" class="zoom-btn" aria-expanded="false">
          <img src="https://images.unsplash.com/photo-1513245543132-31f507417b26?auto=format&fit=crop&w=900&q=70" alt="Prowling Cat" loading="lazy">
          <span class="zoom-caption"><strong>Prowling Cat</strong><small>Silent, patient, precise.</small></span>
        </button>
      </li>
      <li class="zoom-panel">
        <button type="button" class="zoom-btn" aria-expanded="false">
          <img src="https://images.unsplash.com/photo-1529778873920-4da4926a72c2?auto=format&fit=crop&w=900&q=70" alt="Cosy Cat" loading="lazy">
          <span class="zoom-caption"><strong>Cosy Cat</strong><small>Found the warmest spot.</small></span>
        </button>
      </li>
    </ul>
  </div>
</section>

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