Skip to main content

Pagination

Component status:Ready
Pagination is used to navigate from page to page in paginated content, with a control for navigating to the next or previous page.

Examples

Default

The Default Pagination component is used to break up large sets of data across multiple pages. It is commonly used to navigate through items returned from a search or filtering operation.

<nav role="navigation" aria-label="Pages" class="bux-pagination">
<ul class="bux-pagination__list">
<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--previous"
href="#"
aria-label="Go to previous page"
></a>
</li>

<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 1"
>1</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 2"
>2</a
>
</li>
<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--current"
href="[object Object]"
aria-label="Current page, page 3"
aria-current="true"
>3</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 4"
>4</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 5"
>5</a
>
</li>

<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--next"
href="#"
aria-label="Go to next page"
></a>
</li>
</ul>
</nav>

Alternate Pagination

An alternate pagination style with a more subtle hover effect.

<nav
role="navigation"
aria-label="Pages"
class="bux-pagination bux-pagination--alt"
>
<ul class="bux-pagination__list">
<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--previous"
href="#"
aria-label="Go to previous page"
></a>
</li>

<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 1"
>1</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 2"
>2</a
>
</li>
<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--current"
href="[object Object]"
aria-label="Current page, page 3"
aria-current="true"
>3</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 4"
>4</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 5"
>5</a
>
</li>

<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--next"
href="#"
aria-label="Go to next page"
></a>
</li>
</ul>
</nav>

Reverse Pagination

Pagination for use on a dark background.

<nav
role="navigation"
aria-label="Pages"
class="bux-pagination bux-pagination--reverse"
>
<ul class="bux-pagination__list">
<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--previous"
href="#"
aria-label="Go to previous page"
></a>
</li>

<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 1"
>1</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 2"
>2</a
>
</li>
<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--current"
href="[object Object]"
aria-label="Current page, page 3"
aria-current="true"
>3</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 4"
>4</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 5"
>5</a
>
</li>

<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--next"
href="#"
aria-label="Go to next page"
></a>
</li>
</ul>
</nav>

Truncated Pagination

Behavior of the pagination when there are more pages than can be displayed at one time.

<nav role="navigation" aria-label="Pages" class="bux-pagination">
<ul class="bux-pagination__list">
<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--previous"
href="#"
aria-label="Go to previous page"
></a>
</li>

<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 1"
>1</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 2"
>2</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 3"
>3</a
>
</li>
<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--current"
href="[object Object]"
aria-label="Current page, page 4"
aria-current="true"
>4</a
>
</li>
<li class="bux-pagination__item">
<a class="bux-pagination__link" href="[object Object]" aria-label="Page 5"
>5</a
>
</li>

<li class="bux-pagination__item">
<span
class="bux-pagination__link bux-pagination__link--truncated"
aria-hidden="true"
role="presentation"
></span>
</li>

<li class="bux-pagination__item">
<a
class="bux-pagination__link bux-pagination__link--next"
href="#"
aria-label="Go to next page"
></a>
</li>
</ul>
</nav>

Document Pagination

The Document Pagination component is used for page-by-page navigation through content that is meant to be viewed in sequential order. It is often used for content such as books, manuals, or courses.

<nav aria-label="Document pages" class="bux-doc-pagination">
<div class="bux-doc-pagination__item bux-doc-pagination__item--prev">
<a
href=""
class="bux-doc-pagination__link bux-doc-pagination__link--prev"
rel="prev"
>
<div class="bux-doc-pagination__label bux-doc-pagination__label--prev">
Page 3
</div>
</a>
</div>
<div class="bux-doc-pagination__item bux-doc-pagination__item--next">
<a
href=""
class="bux-doc-pagination__link bux-doc-pagination__link--next"
rel="next"
>
<div class="bux-doc-pagination__label bux-doc-pagination__label--next">
Page 5
</div>
</a>
</div>
</nav>

Usage

Dos

  • Use on websites where users are looking for specific pieces of content, such as search results, articles related to a tag, or archives
  • Pagination is good for page load since the content on the page is limited by what is shown for each page

Don’ts

  • Don’t use when users are exploring content or browsing aimlessly for something interesting; consider infinite scrolling instead
    • Infinite scrolling will continue to roll out relevant content in a way that is efficient, digestible, and interruption-free
  • Don't use more than five pages in the page list. If the document or collection has more than five pages, use Truncated Pagination instead

Implementation Notes

Javascript

  • The current page in the pagination list must have the aria-current role set to 'page'
  • Pagination must be in a nav landmark

Accessibility

References

Back to top