Snippets Card

Bootstrap 5 Profile Cards with CSS Scroll Snap

A horizontally scrolling row of portrait profile cards that snap into place, with name and role over a soft scrim. Previous and next buttons and the arrow keys move through the row.

Bootstrap 5 No jQuery Jan 2020 2.6K views

<section class="wdw-stage overflow-hidden">
  <div class="container" style="max-width:1040px">
    <div class="d-flex flex-wrap align-items-end justify-content-between gap-3 mb-3">
      <div>
        <span class="wdw-eyebrow">Team</span>
        <h1 class="wdw-heading h2 mt-1 mb-0">Meet the crew</h1>
      </div>
      <div class="d-flex align-items-center gap-3">
        <span class="small fw-semibold wdw-muted" id="snapCount" aria-live="polite">1 / 6</span>
        <div class="d-flex gap-2"><button type="button" class="btn btn-outline-primary rounded-circle p-0 snap-nav" data-dir="-1" aria-label="Previous profiles"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 6-6 6 6 6"/></svg></button><button type="button" class="btn btn-outline-primary rounded-circle p-0 snap-nav" data-dir="1" aria-label="Next profiles"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6"/></svg></button></div>
      </div>
    </div>
    <div class="snap-track" id="snapTrack" tabindex="0" role="region" aria-label="Team profiles, scrollable">
      <article class="snap-card">
        <img src="https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&crop=faces&w=480&h=640&q=70" alt="" loading="lazy">
        <div class="snap-actions"><a href="#" class="snap-act" aria-label="Email Axel Brandt"><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"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></svg></a><a href="#" class="snap-act" aria-label="Message Axel Brandt"><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="M21 12a8 8 0 0 1-11.6 7.1L3 20l1-4.6A8 8 0 1 1 21 12z"/></svg></a></div>
        <div class="snap-info"><div class="snap-chip"><h2 class="h6 mb-1">Axel Brandt</h2><span class="badge rounded-pill snap-role">Engineering lead</span></div></div>
      </article>
      <article class="snap-card">
        <img src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&crop=faces&w=480&h=640&q=70" alt="" loading="lazy">
        <div class="snap-actions"><a href="#" class="snap-act" aria-label="Email Maya Ortiz"><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"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></svg></a><a href="#" class="snap-act" aria-label="Message Maya Ortiz"><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="M21 12a8 8 0 0 1-11.6 7.1L3 20l1-4.6A8 8 0 1 1 21 12z"/></svg></a></div>
        <div class="snap-info"><div class="snap-chip"><h2 class="h6 mb-1">Maya Ortiz</h2><span class="badge rounded-pill snap-role">Product designer</span></div></div>
      </article>
      <article class="snap-card">
        <img src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&crop=faces&w=480&h=640&q=70" alt="" loading="lazy">
        <div class="snap-actions"><a href="#" class="snap-act" aria-label="Email Tom Reyes"><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"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></svg></a><a href="#" class="snap-act" aria-label="Message Tom Reyes"><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="M21 12a8 8 0 0 1-11.6 7.1L3 20l1-4.6A8 8 0 1 1 21 12z"/></svg></a></div>
        <div class="snap-info"><div class="snap-chip"><h2 class="h6 mb-1">Tom Reyes</h2><span class="badge rounded-pill snap-role">Frontend developer</span></div></div>
      </article>
      <article class="snap-card">
        <img src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?auto=format&fit=crop&crop=faces&w=480&h=640&q=70" alt="" loading="lazy">
        <div class="snap-actions"><a href="#" class="snap-act" aria-label="Email Priya Nair"><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"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></svg></a><a href="#" class="snap-act" aria-label="Message Priya Nair"><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="M21 12a8 8 0 0 1-11.6 7.1L3 20l1-4.6A8 8 0 1 1 21 12z"/></svg></a></div>
        <div class="snap-info"><div class="snap-chip"><h2 class="h6 mb-1">Priya Nair</h2><span class="badge rounded-pill snap-role">Data analyst</span></div></div>
      </article>
      <article class="snap-card">
        <img src="https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?auto=format&fit=crop&crop=faces&w=480&h=640&q=70" alt="" loading="lazy">
        <div class="snap-actions"><a href="#" class="snap-act" aria-label="Email Daniel Cho"><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"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></svg></a><a href="#" class="snap-act" aria-label="Message Daniel Cho"><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="M21 12a8 8 0 0 1-11.6 7.1L3 20l1-4.6A8 8 0 1 1 21 12z"/></svg></a></div>
        <div class="snap-info"><div class="snap-chip"><h2 class="h6 mb-1">Daniel Cho</h2><span class="badge rounded-pill snap-role">Customer success</span></div></div>
      </article>
      <article class="snap-card">
        <img src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&crop=faces&w=480&h=640&q=70" alt="" loading="lazy">
        <div class="snap-actions"><a href="#" class="snap-act" aria-label="Email Lena Fischer"><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"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></svg></a><a href="#" class="snap-act" aria-label="Message Lena Fischer"><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="M21 12a8 8 0 0 1-11.6 7.1L3 20l1-4.6A8 8 0 1 1 21 12z"/></svg></a></div>
        <div class="snap-info"><div class="snap-chip"><h2 class="h6 mb-1">Lena Fischer</h2><span class="badge rounded-pill snap-role">Marketing</span></div></div>
      </article>
    </div>
    <div class="snap-dots d-flex justify-content-center gap-2" id="snapDots" aria-hidden="true"></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.