Snippets Pagination

Bootstrap 5 Pagination Styles

Six pagination styles: round pills, a joined segmented bar, outlined squares, chevron previous/next with progress dots, a numbered bar with ellipsis and a results count, and a load-more button with a progress bar.

Bootstrap 5 No jQuery Jul 2019 3.5K views

<section class="wdw-stage">
  <div class="container" style="max-width: 980px;">
    <div class="mb-4">
      <span class="wdw-eyebrow">Components</span>
      <h1 class="wdw-heading h2 mt-1 mb-2">Pagination styles</h1>
      <p class="wdw-muted mb-0">Six ways to page through results. Every example keeps its own state, so click around and use the keyboard too.</p>
    </div>

    <div class="wdw-card p-3 p-md-4">
      <div class="row g-3">
        <div class="col-md-6">
          <div class="pg-cell h-100">
            <div class="fw-semibold">Pill</div><div class="small wdw-muted mb-3">Round numbers, compact and friendly</div>
            <nav aria-label="Pill pagination"><ul class="pagination pg pg-pill mb-0" data-pager data-total="6"></ul></nav>
          </div>
        </div>
        <div class="col-md-6">
          <div class="pg-cell h-100">
            <div class="fw-semibold">Segmented</div><div class="small wdw-muted mb-3">One joined control with arrows</div>
            <nav aria-label="Segmented pagination"><ul class="pagination pg pg-seg mb-0" data-pager data-total="5" data-arrows="1"></ul></nav>
          </div>
        </div>
        <div class="col-md-6">
          <div class="pg-cell h-100">
            <div class="fw-semibold">Outlined squares</div><div class="small wdw-muted mb-3">Quiet borders, strong active state</div>
            <nav aria-label="Square pagination"><ul class="pagination pg pg-sq mb-0" data-pager data-total="5" data-arrows="1"></ul></nav>
          </div>
        </div>
        <div class="col-md-6">
          <div class="pg-cell h-100">
            <div class="fw-semibold">Previous / next</div><div class="small wdw-muted mb-3">Chevron buttons with progress dots</div>
            <nav aria-label="Previous and next pagination" class="d-flex align-items-center gap-3" data-mini data-total="6">
              <button type="button" class="btn pg-round" data-dir="-1" aria-label="Previous page"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 6-6 6 6 6"/></svg></button>
              <div class="flex-grow-1 text-center">
                <div class="pg-dots" data-dots aria-hidden="true"></div>
                <div class="small fw-semibold mt-2" aria-live="polite" data-count></div>
              </div>
              <button type="button" class="btn pg-round pg-round-primary" data-dir="1" aria-label="Next page"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6"/></svg></button>
            </nav>
          </div>
        </div>
        <div class="col-12">
          <div class="pg-cell">
            <div class="fw-semibold">Numbered with ellipsis</div><div class="small wdw-muted mb-3">Long result sets with a results count</div>
            <div class="d-flex flex-column flex-lg-row align-items-lg-center justify-content-between gap-3">
              <p class="small wdw-muted mb-0" id="pg-info" aria-live="polite">Showing <strong>1-10</strong> of <strong>248</strong> results</p>
              <nav aria-label="Results pagination"><ul class="pagination pg pg-pill pg-dense mb-0" data-pager data-total="25" data-ellipsis="1" data-arrows="1" data-info="pg-info" data-items="248" data-per="10"></ul></nav>
            </div>
          </div>
        </div>
        <div class="col-12">
          <div class="pg-cell" data-more data-total="24" data-step="8">
            <div class="fw-semibold">Load more</div><div class="small wdw-muted mb-3">Append results instead of changing pages</div>
            <div class="d-flex justify-content-between small mb-2"><span aria-live="polite" data-more-count></span><span class="wdw-muted" data-more-pct></span></div>
            <div class="progress pg-progress" role="progressbar" aria-label="Results loaded" aria-valuemin="0" aria-valuemax="100"><div class="progress-bar" data-more-bar></div></div>
            <button type="button" class="btn btn-outline-primary rounded-pill w-100 mt-3" data-more-btn>Load more results</button>
          </div>
        </div>
      </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.