Snippets List

Bootstrap 5 Task List with Status Badges

A task list with colour-coded rows, status badges, selectable items with a live count, and cancel and add actions in the footer.

Bootstrap 5 No jQuery Dec 2019 5.6K views

<section class="wdw-stage">
  <div class="container" style="max-width: 680px">
    <div class="wdw-card overflow-hidden">
      <div class="d-flex justify-content-between align-items-center px-4 py-3 border-bottom">
        <h2 class="wdw-heading h5 mb-0">Task list</h2>
        <span class="small wdw-muted" id="tkSummary" aria-live="polite">0 of 0 selected</span>
      </div>
      <ul class="list-group list-group-flush tk-scroll" id="tkList">
        <li class="list-group-item tk-item">
          <input class="form-check-input" type="checkbox" id="tk1">
          <span class="tk-av" aria-hidden="true">B</span><label class="tk-body" for="tk1"><span class="tk-title">Call Sam for payments</span><span class="tk-by">By Bob</span></label>
          <span class="badge rounded-pill text-bg-danger">Rejected</span>
        </li>
        <li class="list-group-item tk-item">
          <input class="form-check-input" type="checkbox" id="tk2">
          <span class="tk-av" aria-hidden="true">J</span><label class="tk-body" for="tk2"><span class="tk-title">Make payment to Bluedart</span><span class="tk-by">By Johnny</span></label>
          <span class="badge rounded-pill bg-primary-subtle text-primary-emphasis border border-primary-subtle">New</span>
        </li>
        <li class="list-group-item tk-item">
          <input class="form-check-input" type="checkbox" id="tk3">
          <span class="tk-av" aria-hidden="true">S</span><label class="tk-body" for="tk3"><span class="tk-title">Office rent</span><span class="tk-by">By Samino</span></label>
          <span class="badge rounded-pill bg-warning-subtle text-warning-emphasis border border-warning-subtle">Due Fri</span>
        </li>
        <li class="list-group-item tk-item">
          <input class="form-check-input" type="checkbox" id="tk4">
          <span class="tk-av" aria-hidden="true">T</span><label class="tk-body" for="tk4"><span class="tk-title">Office grocery shopping</span><span class="tk-by">By Tida</span></label>
          <span class="badge rounded-pill bg-success-subtle text-success-emphasis border border-success-subtle">Approved</span>
        </li>
        <li class="list-group-item tk-item">
          <input class="form-check-input" type="checkbox" id="tk5">
          <span class="tk-av" aria-hidden="true">O</span><label class="tk-body" for="tk5"><span class="tk-title">Ask for lunch to clients</span><span class="tk-by">By Office Admin</span></label>
          <span class="badge rounded-pill text-bg-secondary">Draft</span>
        </li>
      </ul>
      <div class="d-flex justify-content-end align-items-center gap-2 px-4 py-3 border-top bg-body-tertiary">
        <label for="tkNew" class="visually-hidden">New task name</label>
        <input type="text" class="form-control rounded-pill flex-grow-1 d-none" id="tkNew" placeholder="Task name, then press Add" autocomplete="off">
        <button type="button" class="btn btn-link text-body-secondary text-decoration-none fw-semibold" id="tkCancel">Cancel</button>
        <button type="button" class="btn btn-primary rounded-pill px-4" id="tkAdd">Add task</button>
      </div>
    </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.