Overview

Pagination is used to divide large amounts of content into a series of pages. This allows users to navigate through the content more easily, with controls for moving to the next or previous page, and an option to jump to a specific page. Whether it's search results or product catalogues, pagination helps users browse through the content in a more organised and manageable way.

Pagination component features

  • The component features a maximum of 7 slots for numbers and ellipses (overflow indicator)
  • The first slot is always the first page of the set
  • If there are fewer than 7 pages in the set, show only that number of slots
  • The component always shows the first page and current page
  • Next page, previous page, First page and Last page only appear if those pages exist

Default

Example
Theme
<!-- Paginaiton navigation container --> <nav class="text-center hidden-print qld__search-pagination qld__search-pagination--outline" aria-label="pagination"> <!-- Accessible heading for pagination --> <h2 class="sr-only">Pagination</h2> <!-- Pagination list container --> <ul class="qld__search-pagination__list"> <!-- Previous page button --> <li class="prev"> <a class="qld__search-pagination_link" href="#" rel="prev" aria-label="Previous page of results"> <!-- Previous page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"></path></svg> <!-- Previous page button label --> <span>Previous</span> </a> </li> <!-- First number slot --> <li> <a class="qld__search-pagination_link" href="#">1</a> </li> <!-- Second slot (active) --> <li class="active"> <a class="qld__search-pagination_link" href="#">2</a> </li> <!-- Third number slot --> <li> <a class="qld__search-pagination_link" href="#">3</a> </li> <!-- Fourth number slot --> <li> <a class="qld__search-pagination_link" href="#">4</a> </li> <!-- Fifth number slot --> <li> <a class="qld__search-pagination_link" href="#">5</a> </li> <!-- Sixth number slot (Ellipsis button) --> <li class="ellipsis"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="24" height="32" role="img"> <path fill="currentColor" d="M352 256C352 238.3 366.3 224 384 224C401.7 224 416 238.3 416 256C416 273.7 401.7 288 384 288C366.3 288 352 273.7 352 256zM192 256C192 238.3 206.3 224 224 224C241.7 224 256 238.3 256 256C256 273.7 241.7 288 224 288C206.3 288 192 273.7 192 256zM96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224C81.67 224 96 238.3 96 256z"></path> </svg> </li> <!-- Sevenths number slot (Last button) --> <li class="last"> <a href="#">8</a> </li> <!-- Next page button --> <li class="next"> <a class="qld__search-pagination_link" href="#" rel="next" aria-label="Next page of results"> <!-- Previous page label --> <span>Next</span> <!-- Next page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M443.7 266.8l-165.9 176C274.5 446.3 269.1 448 265.5 448c-3.986 0-7.988-1.375-11.16-4.156c-6.773-5.938-7.275-16.06-1.118-22.59L393.9 272H16.59c-9.171 0-16.59-7.155-16.59-15.1S7.421 240 16.59 240h377.3l-140.7-149.3c-6.157-6.531-5.655-16.66 1.118-22.59c6.789-5.906 17.27-5.469 23.45 1.094l165.9 176C449.4 251.3 449.4 260.7 443.7 266.8z"></path></svg> </a> </li> </ul> </nav>

Example fewer than 7 pages

If there are fewer than 7 pages in the set, you should show all numbers and not use overflow indicators.

Example
Theme
<!-- Paginaiton navigation container --> <nav class="text-center hidden-print qld__search-pagination qld__search-pagination--outline" aria-label="pagination"> <!-- Accessible heading for pagination --> <h2 class="sr-only">Pagination</h2> <!-- Pagination list container --> <ul class="qld__search-pagination__list"> <!-- Previous page button --> <li class="prev"> <a class="qld__search-pagination_link" href="#" rel="prev" aria-label="Previous page of results"> <!-- Previous page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"></path></svg> <!-- Previous page button label --> <span>Previous</span> </a> </li> <!-- First number slot --> <li> <a class="qld__search-pagination_link" href="#">1</a> </li> <!-- Second slot (active) --> <li class="num active"> <a class="qld__search-pagination_link" href="#">2</a> </li> <!-- Third number slot --> <li> <a class="qld__search-pagination_link" href="#">3</a> </li> <!-- Fourth number slot --> <li> <a class="qld__search-pagination_link" href="#">4</a> </li> <!-- Fifth number slot --> <li> <a class="qld__search-pagination_link" href="#">5</a> </li> <!-- Sixth number slot (Last button) --> <li class="last"> <a href="#">6</a> </li> <!-- Next page button --> <li class="next"> <a class="qld__search-pagination_link" href="#" rel="next" aria-label="Next page of results"> <!-- Previous page label --> <span>Next</span> <!-- Next page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M443.7 266.8l-165.9 176C274.5 446.3 269.1 448 265.5 448c-3.986 0-7.988-1.375-11.16-4.156c-6.773-5.938-7.275-16.06-1.118-22.59L393.9 272H16.59c-9.171 0-16.59-7.155-16.59-15.1S7.421 240 16.59 240h377.3l-140.7-149.3c-6.157-6.531-5.655-16.66 1.118-22.59c6.789-5.906 17.27-5.469 23.45 1.094l165.9 176C449.4 251.3 449.4 260.7 443.7 266.8z"></path></svg> </a> </li> </ul> </nav>

Example First and last pages

Don't show the previous page link on the first page and don't show the next page link on the last page.

Example
Theme

First page example


Last page example


<h4>First page example</h4> <br> <!-- Paginaiton navigation container --> <nav class="text-center hidden-print qld__search-pagination qld__search-pagination--outline" aria-label="pagination"> <!-- Accessible heading for pagination --> <h2 class="sr-only">Pagination</h2> <!-- Pagination list container --> <ul class="qld__search-pagination__list"> <!-- First number slot --> <li class="active"> <a class="qld__search-pagination_link" href="#">1</a> </li> <!-- Second slot (active) --> <li> <a class="qld__search-pagination_link" href="#">2</a> </li> <!-- Third number slot --> <li> <a class="qld__search-pagination_link" href="#">3</a> </li> <!-- Fourth number slot --> <li> <a class="qld__search-pagination_link" href="#">4</a> </li> <!-- Fifth number slot --> <li> <a class="qld__search-pagination_link" href="#">5</a> </li> <!-- Sixth number slot (Last button) --> <li class="last"> <a href="#">6</a> </li> <!-- Next page button --> <li class="next"> <a class="qld__search-pagination_link" href="https://www.darlingdowns.health.qld.gov.au/search?query=test&amp;start_rank=16" rel="next" aria-label="Next page of results"> <!-- Previous page label --> <span>Next</span> <!-- Next page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M443.7 266.8l-165.9 176C274.5 446.3 269.1 448 265.5 448c-3.986 0-7.988-1.375-11.16-4.156c-6.773-5.938-7.275-16.06-1.118-22.59L393.9 272H16.59c-9.171 0-16.59-7.155-16.59-15.1S7.421 240 16.59 240h377.3l-140.7-149.3c-6.157-6.531-5.655-16.66 1.118-22.59c6.789-5.906 17.27-5.469 23.45 1.094l165.9 176C449.4 251.3 449.4 260.7 443.7 266.8z"></path></svg> </a> </li> </ul> </nav> <h4>Last page example</h4> <br> <!-- Paginaiton navigation container --> <nav class="text-center hidden-print qld__search-pagination qld__search-pagination--outline" aria-label="pagination"> <!-- Accessible heading for pagination --> <h2 class="sr-only">Pagination</h2> <!-- Pagination list container --> <ul class="qld__search-pagination__list"> <!-- Previous page button --> <li class="prev"> <a class="qld__search-pagination_link" href="#" rel="prev" aria-label="Previous page of results"> <!-- Previous page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"></path></svg> <!-- Previous page button label --> <span>Previous</span> </a> </li> <!-- First number slot --> <li> <a class="qld__search-pagination_link" href="#">1</a> </li> <!-- Second slot (active) --> <li> <a class="qld__search-pagination_link" href="#">2</a> </li> <!-- Third number slot --> <li> <a class="qld__search-pagination_link" href="#">3</a> </li> <!-- Fourth number slot --> <li> <a class="qld__search-pagination_link" href="#">4</a> </li> <!-- Fifth number slot --> <li> <a class="qld__search-pagination_link" href="#">5</a> </li> <!-- Sixth number slot (Last button) --> <li class="last active"> <a href="#">6</a> </li> </ul> </nav>

Overflow indicators small screens

Show only a maximum 1-3 pages at once, depending on the number of pages in your list these might include:

  • the current page
  • previous and next buttons
  • first and last pages.
Example
Theme

Secondary page example


Middle page example


Last page example


<h4>Secondary page example</h4> <br> <!-- Paginaiton navigation container --> <nav class="text-center hidden-print qld__search-pagination qld__search-pagination--outline" aria-label="pagination"> <!-- Accessible heading for pagination --> <h2 class="sr-only">Pagination</h2> <!-- Pagination list container --> <ul class="qld__search-pagination__list"> <!-- Previous page button --> <li class="prev"> <a class="qld__search-pagination_link" href="#" rel="prev" aria-label="Previous page of results"> <!-- Previous page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"></path></svg> </a> </li> <!-- First number slot --> <li class="num"> <a class="qld__search-pagination_link" href="#">1</a> </li> <!-- Second number slot --> <li class="num active" > <a class="qld__search-pagination_link" href="#">2</a> </li> <!-- Third number slot --> <li class="num" > <a class="qld__search-pagination_link" href="#">3</a> </li> <!-- Fourth number slot (Ellipsis button) --> <li class="ellipsis"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="24" height="32" role="img"> <path fill="currentColor" d="M352 256C352 238.3 366.3 224 384 224C401.7 224 416 238.3 416 256C416 273.7 401.7 288 384 288C366.3 288 352 273.7 352 256zM192 256C192 238.3 206.3 224 224 224C241.7 224 256 238.3 256 256C256 273.7 241.7 288 224 288C206.3 288 192 273.7 192 256zM96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224C81.67 224 96 238.3 96 256z"></path> </svg> </li> <!-- Fith number slot --> <li class="num"> <a class="qld__search-pagination_link" href="#">8</a> </li> <!-- Next page button --> <li class="next"> <a class="qld__search-pagination_link" href="#" rel="next" aria-label="Next page of results"> <!-- Next page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M443.7 266.8l-165.9 176C274.5 446.3 269.1 448 265.5 448c-3.986 0-7.988-1.375-11.16-4.156c-6.773-5.938-7.275-16.06-1.118-22.59L393.9 272H16.59c-9.171 0-16.59-7.155-16.59-15.1S7.421 240 16.59 240h377.3l-140.7-149.3c-6.157-6.531-5.655-16.66 1.118-22.59c6.789-5.906 17.27-5.469 23.45 1.094l165.9 176C449.4 251.3 449.4 260.7 443.7 266.8z"></path></svg> </a> </li> </ul> </nav> <h4>Middle page example</h4> <br> <!-- Paginaiton navigation container --> <nav class="text-center hidden-print qld__search-pagination qld__search-pagination--outline" aria-label="pagination"> <!-- Accessible heading for pagination --> <h2 class="sr-only">Pagination</h2> <!-- Pagination list container --> <ul class="qld__search-pagination__list"> <!-- Previous page button --> <li class="prev"> <a class="qld__search-pagination_link" href="#" rel="prev" aria-label="Previous page of results"> <!-- Previous page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"></path></svg> </a> </li> <!-- First number slot --> <li class="num"> <a class="qld__search-pagination_link" href="#">1</a> </li> <!-- Second number slot (Ellipsis button)--> <li class="ellipsis"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="24" height="32" role="img"> <path fill="currentColor" d="M352 256C352 238.3 366.3 224 384 224C401.7 224 416 238.3 416 256C416 273.7 401.7 288 384 288C366.3 288 352 273.7 352 256zM192 256C192 238.3 206.3 224 224 224C241.7 224 256 238.3 256 256C256 273.7 241.7 288 224 288C206.3 288 192 273.7 192 256zM96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224C81.67 224 96 238.3 96 256z"></path> </svg> </li> <!-- Third number slot --> <li class="num active" > <a class="qld__search-pagination_link" href="#">4</a> </li> <!-- Fourth number slot (Ellipsis button) --> <li class="ellipsis"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="24" height="32" role="img"> <path fill="currentColor" d="M352 256C352 238.3 366.3 224 384 224C401.7 224 416 238.3 416 256C416 273.7 401.7 288 384 288C366.3 288 352 273.7 352 256zM192 256C192 238.3 206.3 224 224 224C241.7 224 256 238.3 256 256C256 273.7 241.7 288 224 288C206.3 288 192 273.7 192 256zM96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224C81.67 224 96 238.3 96 256z"></path> </svg> </li> <!-- Fith number slot --> <li class="num"> <a class="qld__search-pagination_link" href="#">8</a> </li> <!-- Next page button --> <li class="next"> <a class="qld__search-pagination_link" href="#" rel="next" aria-label="Next page of results"> <!-- Next page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M443.7 266.8l-165.9 176C274.5 446.3 269.1 448 265.5 448c-3.986 0-7.988-1.375-11.16-4.156c-6.773-5.938-7.275-16.06-1.118-22.59L393.9 272H16.59c-9.171 0-16.59-7.155-16.59-15.1S7.421 240 16.59 240h377.3l-140.7-149.3c-6.157-6.531-5.655-16.66 1.118-22.59c6.789-5.906 17.27-5.469 23.45 1.094l165.9 176C449.4 251.3 449.4 260.7 443.7 266.8z"></path></svg> </a> </li> </ul> </nav> <h4>Last page example</h4> <br> <!-- Paginaiton navigation container --> <nav class="text-center hidden-print qld__search-pagination qld__search-pagination--outline" aria-label="pagination"> <!-- Accessible heading for pagination --> <h2 class="sr-only">Pagination</h2> <!-- Pagination list container --> <ul class="qld__search-pagination__list"> <!-- Previous page button --> <li class="prev"> <a class="qld__search-pagination_link" href="#" rel="prev" aria-label="Previous page of results"> <!-- Previous page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"></path></svg> </a> </li> <!-- First number slot --> <li class="num"> <a class="qld__search-pagination_link" href="#">1</a> </li> <!-- Second number slot (Ellipsis button)--> <li class="ellipsis"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="24" height="32" role="img"> <path fill="currentColor" d="M352 256C352 238.3 366.3 224 384 224C401.7 224 416 238.3 416 256C416 273.7 401.7 288 384 288C366.3 288 352 273.7 352 256zM192 256C192 238.3 206.3 224 224 224C241.7 224 256 238.3 256 256C256 273.7 241.7 288 224 288C206.3 288 192 273.7 192 256zM96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224C81.67 224 96 238.3 96 256z"></path> </svg> </li> <!-- Third number slot --> <li class="num"> <a class="qld__search-pagination_link" href="#">6</a> </li> <!-- Fourth number slot --> <li class="num"> <a class="qld__search-pagination_link" href="#">7</a> </li> <!-- Fifth number slot --> <li class="num active"> <a class="qld__search-pagination_link" href="#">8</a> </li> </ul> </nav>

Overflow indicators large screens

On larger screens with more pages, show:

  • the current page
  • at least one page immediately before and after the current page
  • first and last pages
  • previous and next buttons.
Example
Theme
<!-- Paginaiton navigation container --> <nav class="text-center hidden-print qld__search-pagination qld__search-pagination--outline" aria-label="pagination"> <!-- Accessible heading for pagination --> <h2 class="sr-only">Pagination</h2> <!-- Pagination list container --> <ul class="qld__search-pagination__list"> <!-- Previous page button --> <li class="prev"> <a class="qld__search-pagination_link" href="#" rel="prev" aria-label="Previous page of results"> <!-- Previous page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M448 256C448 264.8 440.6 272 431.4 272H54.11l140.7 149.3c6.157 6.531 5.655 16.66-1.118 22.59C190.5 446.6 186.5 448 182.5 448c-4.505 0-9.009-1.75-12.28-5.25l-165.9-176c-5.752-6.094-5.752-15.41 0-21.5l165.9-176c6.19-6.562 16.69-7 23.45-1.094c6.773 5.938 7.275 16.06 1.118 22.59L54.11 240h377.3C440.6 240 448 247.2 448 256z"></path></svg> <!-- Previous page button label --> <span>Previous</span> </a> </li> <!-- First number slot --> <li> <a class="qld__search-pagination_link" href="#">1</a> </li> <!-- Second number slot --> <li class="ellipsis"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="24" height="32" role="img"> <path fill="currentColor" d="M352 256C352 238.3 366.3 224 384 224C401.7 224 416 238.3 416 256C416 273.7 401.7 288 384 288C366.3 288 352 273.7 352 256zM192 256C192 238.3 206.3 224 224 224C241.7 224 256 238.3 256 256C256 273.7 241.7 288 224 288C206.3 288 192 273.7 192 256zM96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224C81.67 224 96 238.3 96 256z"></path> </svg> </li> <!-- Third number slot --> <li> <a class="qld__search-pagination_link" href="#">6</a> </li> <!-- Fourth number slot --> <li class="active"> <a class="qld__search-pagination_link" href="#">7</a> </li> <!-- Fifth number slot --> <li> <a class="qld__search-pagination_link" href="#">8</a> </li> <!-- Sixth number slot (Ellipsis button) --> <li class="ellipsis"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="24" height="32" role="img"> <path fill="currentColor" d="M352 256C352 238.3 366.3 224 384 224C401.7 224 416 238.3 416 256C416 273.7 401.7 288 384 288C366.3 288 352 273.7 352 256zM192 256C192 238.3 206.3 224 224 224C241.7 224 256 238.3 256 256C256 273.7 241.7 288 224 288C206.3 288 192 273.7 192 256zM96 256C96 273.7 81.67 288 64 288C46.33 288 32 273.7 32 256C32 238.3 46.33 224 64 224C81.67 224 96 238.3 96 256z"></path> </svg> </li> <!-- Sevenths number slot (Last button) --> <li class="last"> <a href="#">12</a> </li> <!-- Next page button --> <li class="next"> <a class="qld__search-pagination_link" href="#" rel="next" aria-label="Next page of results"> <!-- Previous page label --> <span>Next</span> <!-- Next page button icon --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-hidden="true" focusable="false" width="16" height="16" role="img"><path fill="currentColor" d="M443.7 266.8l-165.9 176C274.5 446.3 269.1 448 265.5 448c-3.986 0-7.988-1.375-11.16-4.156c-6.773-5.938-7.275-16.06-1.118-22.59L393.9 272H16.59c-9.171 0-16.59-7.155-16.59-15.1S7.421 240 16.59 240h377.3l-140.7-149.3c-6.157-6.531-5.655-16.66 1.118-22.59c6.789-5.906 17.27-5.469 23.45 1.094l165.9 176C449.4 251.3 449.4 260.7 443.7 266.8z"></path></svg> </a> </li> </ul>

Usage guidelines

When to use

Use pagination when displaying large sets of content that would be difficult to display on a single page, such as search results or a long list of products. Pagination can make it easier for users to find what they're looking for by breaking the content into manageable chunks.

Pagination is a useful feature for displaying listings on websites, such as ecommerce category pages, SERPs, article archives, and photo galleries. On these pages, users typically have a specific goal in mind and want to find a particular item or article. Instead of scrolling through a long list, pagination breaks the content into manageable chunks, making it easier for users to navigate and find what they're looking for. Once they find the specific item, they can simply click through to the destination page, rather than having to go through the full list (Nielsen, 2011).

Consider using pagination when:

  • showing all the content on a single page makes the page take too long to load (UK.GOV n.d.).
  • most users only need the content on the first page or first few pages (UK.GOV n.d.).

When not to use

  • Don't use pagination when displaying a small set of content that can be easily displayed on a single page, as pagination can add unnecessary complexity and inconvenience for users. Avoid using the ‘infinite scroll’ technique to automatically load content when the user approaches the bottom of the page. This causes problems for keyboard users.
  • Don't use this Pagination component for linear journeys — for example, where you’re asking the user to complete a form. Instead, use the Button component (usually a ‘Continue’ button) to let the user move to the next page — and a back link to let them move to the previous page (UK.GOV. n.d.).

Meaningful page groupings: If you have long content split meaningfully, or grouped by subject or theme, use conventional navigation like Side navigation. (US Design system n.d.).

How to use

Design

Show the page number in the page <title> so that screen reader users know they’ve navigated to a different page. For example, ‘Search results (page 1 of 4)’ (UK.GOV, n.d.).

Placement

Consider the placement of pagination controls carefully. Typically, pagination is placed at the bottom of the content list to give users visibility and flexibility to move throughout the pages. For longer pages it may be beneficial to provide pagination at the top and at bottom. It gives 2 major benefits, first is chances of missing out pagination are less and second users get flexibility to go to other pages easily.

How many items to display

When determining the optimal number of list items to display per page, consider the following factors:

User experience: Prioritise user experience when deciding how many list items to show. The number should be large enough to minimize the need for users to click through multiple pages, but not so large that it negatively affects the page load time or overwhelms users.

Content type: The optimal number of list items may vary depending on the type of content you're displaying. For instance, a list of search results might warrant a different number of items per page than a list of blog posts or e-commerce products.

Device and screen size: Keep in mind that users may be accessing your content on various devices with different screen sizes. A responsive design that adapts the number of list items displayed based on the user's device is often recommended. Mobile testing results reveal that users experience fatigue with long product lists much sooner on mobile than on desktop (Hugo, 2020).

Load time: Be mindful of the impact of the number of list items on page load time. If your list items are resource-intensive, displaying too many per page can slow down the load time and negatively affect the user experience.

Some general recommendations for the number of list items in pagination are:

  • for search results: 10-20 items per page is a common recommendation
  • for e-commerce products: 20-50 items per page can provide a good balance between user experience and performance
  • for content-heavy websites (e.g., news articles, blog posts): 5-15 items per page is often suggested.

Remember that these are just general guidelines, and it's essential to test and gather user feedback to determine the best number of list items for your specific website or application.

Research and rationale

The design of our pagination component was inspired by research conducted by UK.GOV design system team and by the guidelines set out by the USA Design system.

Next and previous

When implementing pagination, UK Governs suggest that you should include clear and prominent controls for navigating between pages, such as a "next" and "previous" button, as well as an option to jump to a specific page. The first and last page number should always be shown and a user’s current page is always highlighted (UK.GOV n.d.).

We found this to be consistent with other pagination examples and best practice guidelines. Our component follows these practices. After testing however, we chose to remove the words next and previous on mobile devices to ensure that the pagination remained and on a single line.

Number of items

In our review of this component, we found that the US Government Design System had developed very comprehensive guidelines for behaviour of this component based on a 7 slot matrix. We combined these with the guidance outlined in UK.GOV to develop the rules for how our pagination would work across multiple screen sizes and differing pages numbers.

We found that using 7 slots for pagination strikes a balance between usability, user experience, and accessibility. It allows for the first and last page, two overflow ellipses, the current page and the previous and next page. Limiting pagination to 7 slots helps conserve screen space, allowing for a cleaner and less cluttered user interface and having 7 slots keeps the cognitive load manageable, making it easier for users to process the information.

The UK.GOV design system offered some good guidelines for mobile devices as well where it suggested limiting the number of slots to 5. This helps ensure pagination doesn't stack when there is less screen space.

Classes

NameDescription

qld__search-pagination qld__search-pagination--outline

Wrapper class for pagination applied to <nav>.

qld__search-pagination__list

Class for pagination ul.

qld__search-pagination_link

Style for pagination page number links.

active

Class for current active page applied to <li>.

ellipsis

Class that styles slot as an overflow ellipse indicator.

hidden-print

Hides content on print.

text-center

Centres text.

Accessible pagination requirements

Keep these considerations in mind if you are modifying the design system or creating a custom component.

WCAG guidelines

1.3.1 Info and Relationships

Identify pagination as a navigation section

Enclose Pagination in a <nav> element to signify it as a navigation section to screen readers and other assistive technologies.

Implement an unordered list for the navigation items, allowing screen readers to announce the number of elements in the Pagination component.

1.4.3 Contrast (Minimum)

Ensure that the text and background colours of pagination controls have a contrast ratio of at least 4.5:1 to accommodate users with low vision or colour deficiencies.

1.4.8 Visual Presentation

Avoid large horizontal gaps between elements

Prevent large horizontal gaps between elements to accommodate users with limited vision or mobility. Excessive horizontal space between elements might cause users to stop scanning and miss an element in the reading order.

2.1.1 Keyboard

Keyboard accessibility

Ensure that all pagination functionality is operable through a keyboard interface without requiring specific timings for individual keystrokes.

2.4.7 Focus Visible

Focus visibility

Make sure that any keyboard-operable user interface, such as pagination controls, has a visible focus indicator. This assists users who rely on keyboard navigation.

2.4.6 Headings and Labels

Clear labels for navigation elements

Provide clear and descriptive labels for the pagination controls, such as "Next" and "Previous," to ensure that users understand the purpose of the controls.

4.1.2 Name, Role, Value

Provide descriptive ARIA labels for navigation

Assign a unique, descriptive ARIA label to the Pagination component's <nav> element that conveys its purpose, such as aria-label="search results page". Ensure that each Pagination component on a page has a distinct ARIA label.

Apply aria-current="page" to the current page's link item for proper screen reader voicing.

Use aria-label="page [#]" on each page link to clarify that the numbers are links to page numbers.

For the last page in a bounded set, employ aria-label="last page, page [#]" on the last page's link. Exclude this label from the last navigation element in an unbounded set since it has no definitive last page.

Even though it may seem counterintuitive, include a link to the current page in your Pagination component. This ensures that screen readers voice the current page, whether the user navigates by element or by tabbing.


References

Nielsen J (2011) View All Items, Nielsen Norman Group, accessed 24 April 2023.

Lennartz S (2007) Pagination Gallery: Examples and Good Practices, Smashing Magazine, accessed 24 April 2023.

Hugo R (2020) Number of Items Loaded by Default: Why It Matters & How Many to Load, Baymard Institute, accessed 24 April 2023.

U.S. Web Design System (n.d.) Pagination, Design System Digital, accessed 24 April 2023.

GOV.UK (n.d.) Pagination, GOV.UK Design System, accessed 24 April 2023.

Last updated: August 2023