Skip to content

Pagination

Navigation between pages of a long list. Each page is a link with its own address, not a button: the user can then open page three in a new tab, copy the address, and come back with the back button.

A number on its own says little when it is read out in the middle of a sequence. aria-label="Page 3" makes the link understandable, and aria-current="page" says which page the user is on.

If the user is on the first page, “Previous” should not be a link. Replace it with <span aria-disabled="true"> or leave it out.

ClassWhat it is
.lt-paginationThe list of pages. The links and buttons inside are styled by the component.
.lt-pagination__gapThe gap in the number sequence, as in “1 2 … 9 10”
VariableDefault
--lt-pagination-gapvar(--lt-spacing-1)
--lt-pagination-sizevar(--lt-spacing-10)
--lt-pagination-radiusvar(--lt-spacing-1)

--lt-pagination-size is the minimum width and height of each number. WCAG 2.2 requires 24 pixels; the default here is 40, because a number in a long row is easy to miss with a finger.

See Customising for how the variables and the layer work.

  • Say where the user is, also outside the pagination itself: “Showing 21 to 40 of 184 cases” above the list helps more than the row of numbers alone.
  • After a new page has loaded, move focus to the top of the list. Otherwise focus stays on a number that now means something else.
  • If the list has few pages, show them all. The ”…” gap is only worth it from around ten pages up.
  • If the content is an endless stream, a “Show more” button is often better than page numbers. Infinite scrolling without a button makes the footer unreachable.