Snippets Pagination

Bootstrap 5 Month Pagination with Year Switcher

A month picker for calendars and event archives: a single pill bar of twelve months with the year shown once, dots on months that have events, and arrows that step month by month and roll over the year. The selected month lists its events below.

Bootstrap 5 No jQuery Jul 2019 2.3K views

<section class="wdw-stage">
  <div class="container" style="max-width:960px;min-width:0">
    <div class="wdw-card p-4 p-md-5">
      <div class="d-flex flex-wrap justify-content-between align-items-center gap-3 mb-4">
        <div><span class="wdw-eyebrow">Calendar</span><h2 class="wdw-heading h3 mt-1 mb-0">Browse by month</h2></div>
        <div class="d-flex align-items-center gap-2">
          <button type="button" class="btn btn-outline-secondary rounded-circle p-0" style="width:44px" id="mpPrev" aria-label="Previous month"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 6-6 6 6 6"/></svg></button>
          <span class="fw-bold fs-5 text-body-emphasis text-center" style="min-width:4.5rem" id="mpYear">2026</span>
          <button type="button" class="btn btn-outline-secondary rounded-circle p-0" style="width:44px" id="mpNext" aria-label="Next month"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6"/></svg></button>
        </div>
      </div>
      <div class="mp p-1 rounded-4 bg-body-tertiary border" role="radiogroup" aria-label="Month" id="mpList"></div>
      <div class="d-flex align-items-center gap-2 mt-4 mb-2"><h3 class="h6 fw-bold mb-0" id="mpOut" role="status" aria-live="polite"></h3><span class="small wdw-muted d-inline-flex align-items-center gap-1 ms-auto"><span class="mp-dot-key" aria-hidden="true"></span>Has events</span></div>
      <ul class="list-group list-group-flush" id="mpEvents"></ul>
    </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.