Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Bootstrap pagination uses a labeled navigation landmark containing a list of page links. In the Bootstrap 5.3 documentation, the pattern is <nav>, <ul class="pagination">, .page-item list items, and .page-link links. The example below uses that documented structure; replace its sample URLs with real destinations and make the current-page state match the page being displayed.

Build the pagination markup

Use a separate <nav> element for the pagination and give it a label that describes the content it controls. The list and class names supply Bootstrap’s component styling; the links need real destinations so each page can be reached.

<nav aria-label="Search results pages">
  <ul class="pagination">
    <li class="page-item disabled">
      <span class="page-link">Previous</span>
    </li>
    <li class="page-item">
      <a class="page-link" href="/search?page=1">1</a>
    </li>
    <li class="page-item active">
      <a class="page-link" href="/search?page=2" aria-current="page">2</a>
    </li>
    <li class="page-item">
      <a class="page-link" href="/search?page=3">3</a>
    </li>
    <li class="page-item">
      <a class="page-link" href="/search?page=3">Next</a>
    </li>
  </ul>
</nav>

This is a structural example, not a tested implementation. Your application must supply valid page routes and the behavior that returns the corresponding results.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Label the navigation and current page

A descriptive aria-label distinguishes this navigation from other navigation regions on the page. Choose wording tied to the content, such as “Search results pages” or “Article pages,” rather than a generic label.

Put .active on the current page’s .page-item and add aria-current="page" to its link. Update both when the displayed page changes. If you represent the current page with a non-interactive element such as a <span>, Bootstrap’s documentation says aria-current may be omitted.

Handle unavailable previous and next pages

At the start or end of a result set, do not leave a usable link that points to an unavailable page. Bootstrap’s .disabled class changes the item’s appearance and pointer interaction, but the class alone does not resolve keyboard accessibility. Bootstrap’s documented guidance includes adding the appropriate behavior to prevent activation, or using a non-interactive <span> instead of a link. The example uses a span for the unavailable “Previous” control.

Use icons without losing their meaning

If you use symbols instead of words for previous and next, give each link an accessible name and mark a purely decorative symbol as hidden from assistive technology. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<a class="page-link" href="/search?page=2" aria-label="Previous page">
  <span aria-hidden="true">«</span>
</a>

A glyph such as « or » alone does not clearly communicate the link’s purpose to every reader. Bootstrap’s guidance on icon pagination is documented in its v5.0 Pagination documentation.

Change size and alignment

Bootstrap 5.3 documents large and small pagination variants, plus flexbox utility classes for positioning the list:

  • .pagination-lg makes the pagination larger; .pagination-sm makes it smaller.
  • .justify-content-center centers the list.
  • .justify-content-end aligns it to the end of its container.

For example, add a size class to the list and an alignment utility to it: <ul class="pagination pagination-lg justify-content-center">. Choose the variant that fits the surrounding layout.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Customize the appearance responsibly

Bootstrap 5.3 documents local CSS variables on .pagination; that variable support was added in Bootstrap 5.2.0, and Sass customization remains supported. See the Bootstrap v5.3 Pagination documentation for the component options and the Bootstrap v5.2 Pagination documentation for version context.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Bootstrap does not guarantee that every resulting design is accessible. Its v5.2 Accessibility documentation cautions that project accessibility depends substantially on the author’s markup, additional styling, and scripting, and notes that some default palette combinations may have insufficient contrast against light backgrounds. Check the colors and keyboard behavior in your actual implementation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.