Snippets List

Bootstrap 5 Forum Thread List with Search and Pagination

A forum thread list with status badges, reply counts and last-activity avatars, plus live search, a New thread button and pagination. It collapses into a compact stacked layout on phones.

Bootstrap 5 No jQuery Dec 2019 6.7K views

<section class="wdw-stage align-items-start align-items-md-center">
  <div class="container" style="max-width:920px">
    <div class="d-flex flex-wrap align-items-center justify-content-between gap-3 mb-4">
      <div><span class="wdw-eyebrow">Community</span><h2 class="wdw-heading h3 mb-0 mt-1">General discussion</h2></div>
      <div class="d-flex gap-2 flex-grow-1 flex-md-grow-0 forum-tools">
        <label class="visually-hidden" for="forumSearch">Search threads</label>
        <input type="search" id="forumSearch" class="form-control" placeholder="Search threads...">
        <button type="button" class="btn btn-primary rounded-pill text-nowrap"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>New thread</button>
      </div>
    </div>
    <div class="wdw-card overflow-hidden">
      <div class="forum-head d-none d-md-grid px-4 py-3 border-bottom small fw-semibold wdw-muted text-uppercase"><span>Topic</span><span>Replies</span><span>Last update</span></div>
      <ul class="list-unstyled m-0" id="forumList">
        <li class="forum-row px-3 px-md-4 py-3 border-bottom">
          <div ><a href="#" class="forum-title fw-semibold text-body-emphasis text-decoration-none">How can I change my username?</a>
            <div class="small wdw-muted mt-1">Started 25 days ago · Neon Mandela</div></div>
          <div class="forum-replies"><span class="fw-semibold text-body-emphasis">12</span><span class="d-md-none small wdw-muted"> replies</span></div>
          <div class="d-flex align-items-center gap-2 forum-last"><img src="https://i.pravatar.cc/72?img=12" width="36" height="36" class="rounded-circle" alt="" loading="lazy"><div class="small lh-sm"><div class="text-body-emphasis">1 day ago</div><div class="wdw-muted">by Tim Cook</div></div></div>
        </li>
        <li class="forum-row px-3 px-md-4 py-3 border-bottom">
          <div ><a href="#" class="forum-title fw-semibold text-body-emphasis text-decoration-none">How do I switch the theme to dark mode?</a><span class="badge rounded-pill text-bg-success ms-1 align-middle">Solved</span>
            <div class="small wdw-muted mt-1">Started 5 days ago · Allize Rome</div></div>
          <div class="forum-replies"><span class="fw-semibold text-body-emphasis">43</span><span class="d-md-none small wdw-muted"> replies</span></div>
          <div class="d-flex align-items-center gap-2 forum-last"><img src="https://i.pravatar.cc/72?img=14" width="36" height="36" class="rounded-circle" alt="" loading="lazy"><div class="small lh-sm"><div class="text-body-emphasis">1 day ago</div><div class="wdw-muted">by Steve Smith</div></div></div>
        </li>
        <li class="forum-row px-3 px-md-4 py-3 border-bottom">
          <div ><a href="#" class="forum-title fw-semibold text-body-emphasis text-decoration-none">Is it possible to get a refund for a product I purchased today?</a><span class="badge rounded-pill text-bg-secondary ms-1 align-middle">Locked</span>
            <div class="small wdw-muted mt-1">Started 21 days ago · Kane William</div></div>
          <div class="forum-replies"><span class="fw-semibold text-body-emphasis">42</span><span class="d-md-none small wdw-muted"> replies</span></div>
          <div class="d-flex align-items-center gap-2 forum-last"><img src="https://i.pravatar.cc/72?img=32" width="36" height="36" class="rounded-circle" alt="" loading="lazy"><div class="small lh-sm"><div class="text-body-emphasis">2 days ago</div><div class="wdw-muted">by Brett Wilson</div></div></div>
        </li>
        <li class="forum-row px-3 px-md-4 py-3 border-bottom">
          <div ><a href="#" class="forum-title fw-semibold text-body-emphasis text-decoration-none">Do you have an Android app for this tool?</a>
            <div class="small wdw-muted mt-1">Started 56 days ago · Glen Maxwell</div></div>
          <div class="forum-replies"><span class="fw-semibold text-body-emphasis">632</span><span class="d-md-none small wdw-muted"> replies</span></div>
          <div class="d-flex align-items-center gap-2 forum-last"><img src="https://i.pravatar.cc/72?img=33" width="36" height="36" class="rounded-circle" alt="" loading="lazy"><div class="small lh-sm"><div class="text-body-emphasis">11 days ago</div><div class="wdw-muted">by Neil Patel</div></div></div>
        </li>
        <li class="forum-row px-3 px-md-4 py-3 border-bottom">
          <div ><a href="#" class="forum-title fw-semibold text-body-emphasis text-decoration-none">How can I transfer my funds to a friend?</a><span class="badge rounded-pill text-bg-secondary ms-1 align-middle">Closed</span>
            <div class="small wdw-muted mt-1">Started 25 days ago · Marry Tom</div></div>
          <div class="forum-replies"><span class="fw-semibold text-body-emphasis">53</span><span class="d-md-none small wdw-muted"> replies</span></div>
          <div class="d-flex align-items-center gap-2 forum-last"><img src="https://i.pravatar.cc/72?img=52" width="36" height="36" class="rounded-circle" alt="" loading="lazy"><div class="small lh-sm"><div class="text-body-emphasis">1 day ago</div><div class="wdw-muted">by Tibor Tom</div></div></div>
        </li>
        <li class="forum-row px-3 px-md-4 py-3 border-bottom">
          <div ><a href="#" class="forum-title fw-semibold text-body-emphasis text-decoration-none">How do I delete my account?</a><span class="badge rounded-pill text-bg-danger ms-1 align-middle">Hot</span>
            <div class="small wdw-muted mt-1">Started 25 days ago · Bob Bulmer</div></div>
          <div class="forum-replies"><span class="fw-semibold text-body-emphasis">128</span><span class="d-md-none small wdw-muted"> replies</span></div>
          <div class="d-flex align-items-center gap-2 forum-last"><img src="https://i.pravatar.cc/72?img=60" width="36" height="36" class="rounded-circle" alt="" loading="lazy"><div class="small lh-sm"><div class="text-body-emphasis">3 hours ago</div><div class="wdw-muted">by Ross Taylor</div></div></div>
        </li>
      </ul>
      <p class="text-center wdw-muted py-5 m-0 d-none" id="forumEmpty">No threads match your search.</p>
    </div>
    <nav class="d-flex justify-content-center mt-4" aria-label="Thread pages"><ul class="pagination pagination-lg gap-1 mb-0">
      <li class="page-item disabled"><a class="page-link rounded-circle" href="#" aria-label="Previous">«</a></li>
      <li class="page-item active" aria-current="page"><a class="page-link rounded-circle" href="#">1</a></li>
      <li class="page-item"><a class="page-link rounded-circle" href="#">2</a></li>
      <li class="page-item"><a class="page-link rounded-circle" href="#">3</a></li>
      <li class="page-item"><a class="page-link rounded-circle" href="#" aria-label="Next">»</a></li>
    </ul></nav>
  </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.