Snippets Blog

Bootstrap 5 Blog Card Carousel

A swipeable blog card carousel with image cards, category labels, comment counts, arrow buttons and page dots.

Bootstrap 5 No jQuery Oct 2020 2.1K views

<section class="wdw-stage">
  <div class="container" style="max-width:1100px">
    <div class="d-flex align-items-end justify-content-between gap-3 mb-4">
      <div>
        <span class="wdw-eyebrow mb-2">From the blog</span>
        <h1 class="wdw-heading h2 mb-0">Fresh reads this month</h1>
      </div>
      <div class="d-flex gap-2">
        <button type="button" class="btn btn-outline-primary rounded-circle p-0 bc-nav" id="bcPrev" aria-label="Previous posts"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg></button>
        <button type="button" class="btn btn-outline-primary rounded-circle p-0 bc-nav" id="bcNext" aria-label="Next posts"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18l6-6-6-6"/></svg></button>
      </div>
    </div>
    <div class="bc" id="blogCarousel" role="region" aria-roledescription="carousel" aria-label="Latest blog posts">
      <div class="bc-track" id="bcTrack" tabindex="0">
        <article class="bc-slide" role="group" aria-roledescription="slide" aria-label="1 of 6">
          <div class="wdw-card h-100 overflow-hidden d-flex flex-column">
            <div class="position-relative">
              <img src="https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?auto=format&fit=crop&w=720&h=450&q=70" alt="" class="bc-img w-100" width="720" height="450" loading="lazy">
              <span class="badge rounded-pill bg-body text-body-emphasis position-absolute top-0 start-0 m-3 shadow-sm">Aug 01</span>
            </div>
            <div class="p-4 d-flex flex-column flex-grow-1">
              <span class="wdw-eyebrow mb-2">Productivity</span>
              <h3 class="h5 fw-bold mb-2">Designing a desk setup that keeps you focused</h3>
              <p class="wdw-muted small mb-3">Small, deliberate changes to your workspace that cut distraction and make long sessions easier.</p>
              <div class="d-flex align-items-center justify-content-between mt-auto">
                <span class="small wdw-muted">3 comments</span>
                <a href="#" class="link-primary fw-semibold text-decoration-none small stretched-link">Read more →</a>
              </div>
            </div>
          </div>
        </article>
        <article class="bc-slide" role="group" aria-roledescription="slide" aria-label="2 of 6">
          <div class="wdw-card h-100 overflow-hidden d-flex flex-column">
            <div class="position-relative">
              <img src="https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=720&h=450&q=70" alt="" class="bc-img w-100" width="720" height="450" loading="lazy">
              <span class="badge rounded-pill bg-body text-body-emphasis position-absolute top-0 start-0 m-3 shadow-sm">Aug 08</span>
            </div>
            <div class="p-4 d-flex flex-column flex-grow-1">
              <span class="wdw-eyebrow mb-2">Analytics</span>
              <h3 class="h5 fw-bold mb-2">Reading your metrics without the noise</h3>
              <p class="wdw-muted small mb-3">Which numbers matter, which are vanity, and how to build a weekly review you will keep.</p>
              <div class="d-flex align-items-center justify-content-between mt-auto">
                <span class="small wdw-muted">8 comments</span>
                <a href="#" class="link-primary fw-semibold text-decoration-none small stretched-link">Read more →</a>
              </div>
            </div>
          </div>
        </article>
        <article class="bc-slide" role="group" aria-roledescription="slide" aria-label="3 of 6">
          <div class="wdw-card h-100 overflow-hidden d-flex flex-column">
            <div class="position-relative">
              <img src="https://images.unsplash.com/photo-1517694712202-14dd9538aa97?auto=format&fit=crop&w=720&h=450&q=70" alt="" class="bc-img w-100" width="720" height="450" loading="lazy">
              <span class="badge rounded-pill bg-body text-body-emphasis position-absolute top-0 start-0 m-3 shadow-sm">Aug 15</span>
            </div>
            <div class="p-4 d-flex flex-column flex-grow-1">
              <span class="wdw-eyebrow mb-2">Development</span>
              <h3 class="h5 fw-bold mb-2">Shipping faster with smaller pull requests</h3>
              <p class="wdw-muted small mb-3">A simple team agreement that shortens review time and reduces risky releases.</p>
              <div class="d-flex align-items-center justify-content-between mt-auto">
                <span class="small wdw-muted">5 comments</span>
                <a href="#" class="link-primary fw-semibold text-decoration-none small stretched-link">Read more →</a>
              </div>
            </div>
          </div>
        </article>
        <article class="bc-slide" role="group" aria-roledescription="slide" aria-label="4 of 6">
          <div class="wdw-card h-100 overflow-hidden d-flex flex-column">
            <div class="position-relative">
              <img src="https://images.unsplash.com/photo-1504384308090-c894fdcc538d?auto=format&fit=crop&w=720&h=450&q=70" alt="" class="bc-img w-100" width="720" height="450" loading="lazy">
              <span class="badge rounded-pill bg-body text-body-emphasis position-absolute top-0 start-0 m-3 shadow-sm">Aug 22</span>
            </div>
            <div class="p-4 d-flex flex-column flex-grow-1">
              <span class="wdw-eyebrow mb-2">Teamwork</span>
              <h3 class="h5 fw-bold mb-2">Run a retrospective that leads to change</h3>
              <p class="wdw-muted small mb-3">Formats that surface real problems and turn them into one or two clear actions.</p>
              <div class="d-flex align-items-center justify-content-between mt-auto">
                <span class="small wdw-muted">2 comments</span>
                <a href="#" class="link-primary fw-semibold text-decoration-none small stretched-link">Read more →</a>
              </div>
            </div>
          </div>
        </article>
        <article class="bc-slide" role="group" aria-roledescription="slide" aria-label="5 of 6">
          <div class="wdw-card h-100 overflow-hidden d-flex flex-column">
            <div class="position-relative">
              <img src="https://images.unsplash.com/photo-1531297484001-80022131f5a1?auto=format&fit=crop&w=720&h=450&q=70" alt="" class="bc-img w-100" width="720" height="450" loading="lazy">
              <span class="badge rounded-pill bg-body text-body-emphasis position-absolute top-0 start-0 m-3 shadow-sm">Aug 29</span>
            </div>
            <div class="p-4 d-flex flex-column flex-grow-1">
              <span class="wdw-eyebrow mb-2">Tools</span>
              <h3 class="h5 fw-bold mb-2">The lightweight stack behind our content workflow</h3>
              <p class="wdw-muted small mb-3">From idea backlog to published post, using tools you probably already pay for.</p>
              <div class="d-flex align-items-center justify-content-between mt-auto">
                <span class="small wdw-muted">6 comments</span>
                <a href="#" class="link-primary fw-semibold text-decoration-none small stretched-link">Read more →</a>
              </div>
            </div>
          </div>
        </article>
        <article class="bc-slide" role="group" aria-roledescription="slide" aria-label="6 of 6">
          <div class="wdw-card h-100 overflow-hidden d-flex flex-column">
            <div class="position-relative">
              <img src="https://images.unsplash.com/photo-1555066931-4365d14bab8c?auto=format&fit=crop&w=720&h=450&q=70" alt="" class="bc-img w-100" width="720" height="450" loading="lazy">
              <span class="badge rounded-pill bg-body text-body-emphasis position-absolute top-0 start-0 m-3 shadow-sm">Sep 05</span>
            </div>
            <div class="p-4 d-flex flex-column flex-grow-1">
              <span class="wdw-eyebrow mb-2">Code</span>
              <h3 class="h5 fw-bold mb-2">Writing CSS that is still readable in a year</h3>
              <p class="wdw-muted small mb-3">Naming, layering and tokens that keep a growing stylesheet under control.</p>
              <div class="d-flex align-items-center justify-content-between mt-auto">
                <span class="small wdw-muted">4 comments</span>
                <a href="#" class="link-primary fw-semibold text-decoration-none small stretched-link">Read more →</a>
              </div>
            </div>
          </div>
        </article>
      </div>
    </div>
    <div class="d-flex justify-content-center gap-2 mt-4" id="bcDots" role="group" aria-label="Choose slide group"></div>
  </div>
</section>

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

Free to use in personal and commercial projects under the MIT license.