Pagination
Documentation and examples for showing pagination to indicate a series of related content exists across multiple pages.
Overview
We use a large block of connected links for our pagination, making links hard to miss and easily scalable—all while providing large hit areas. Pagination is built with list HTML elements so screen readers can announce the number of available links. Use a wrapping <nav>
element to identify it as a navigation section to screen readers and other assistive technologies.
In addition, as pages likely have more than one such navigation section, it’s advisable to provide a descriptive aria-label
for the <nav>
to reflect its purpose. For example, if the pagination component is used to navigate between a set of search results, an appropriate label could be aria-label="Search results pages"
.
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
With icons
Looking to use an icon or symbol in place of text for some pagination links? Be sure to provide proper screen reader support with aria
attributes.
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
Default
Pagination sm
Pagination default
Pagination lg
<div class="col-12">
<h5 class="text-center">Pagination sm</h5>
<nav class="mb-5" aria-label="navigation">
<ul class="pagination pagination-sm d-inline-block d-md-flex justify-content-center">
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Prev</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item active"><a class="page-link" href="#">2</a></li>
<li class="page-item disabled"><a class="page-link" href="#">..</a></li>
<li class="page-item"><a class="page-link" href="#">15</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
<h5 class="text-center">Pagination default</h5>
<nav class="mb-5" aria-label="navigation">
<ul class="pagination d-inline-block d-md-flex justify-content-center">
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Prev</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item active"><a class="page-link" href="#">2</a></li>
<li class="page-item disabled"><a class="page-link" href="#">..</a></li>
<li class="page-item"><a class="page-link" href="#">15</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
<h5 class="text-center">Pagination lg</h5>
<nav class="mb-5" aria-label="navigation">
<ul class="pagination pagination-lg d-inline-block d-md-flex justify-content-center">
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Prev</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item active"><a class="page-link" href="#">2</a></li>
<li class="page-item disabled"><a class="page-link" href="#">..</a></li>
<li class="page-item"><a class="page-link" href="#">15</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
</div>
Pagination primary soft
<ul class="pagination pagination-primary-soft mb-0">
<li>
<ul class="list-unstyled">
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Prev</a>
</li>
<li class="page-item active"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">..</a></li>
<li class="page-item"><a class="page-link" href="#">22</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</li>
</ul>
Pagination space between
<ul class="pagination pagination-primary-soft d-flex justify-content-between mb-0">
<li>
<ul class="list-unstyled">
<li class="page-item disabled">
<a class="page-link" href="#"><i class="fas fa-long-arrow-alt-left me-2 rtl-flip"></i>Prev</a>
</li>
</ul>
</li>
<li>
<ul class="list-unstyled">
<li class="page-item active"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">..</a></li>
<li class="page-item"><a class="page-link" href="#">22</a></li>
<li class="page-item"><a class="page-link" href="#">23</a></li>
</ul>
</li>
<li>
<ul class="list-unstyled">
<li class="page-item">
<a class="page-link" href="#">Next<i class="fas fa-long-arrow-alt-right ms-2 rtl-flip"></i></a>
</li>
</ul>
</li>
</ul>
View more button Pagination
<button class="btn btn-lg btn-outline-light mb-0"><i class="fa-solid fa-spinner fa-lg me-2"></i>Load more work</button>
Alignment
Change the alignment of pagination components with flexbox utilities.
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-start">
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a>
</li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>