Skip to main content

Numbered

Page numbers in a nav with a label. The current page has aria-current="page" and a filled background, so it is not shown by colour alone. Each number has an aria-label ("Page 3"). The Previous and Next text is hidden on small screens, but the buttons keep their label.

Many pages

Show the first page, the last page and the pages around the current one. The ellipsis is hidden from assistive tech.

Bordered

Every item has a border (an inset-ring), so the limit of each page is clear, as in the pagination of a data table. The current page keeps its filled background and aria-current="page". The same classes work on a a and on a button: add disabled to a button, or aria-disabled="true" to a link, to dim an item that cannot be used.

Cursor-based (previous and next)

For an API that pages with a cursor: the server sends a cursor for the previous and the next page, but no total. So the position is shown as “Page N” without “of M”, and there are no numbers or first and last buttons to jump to. Pass the cursor links as previous-href and next-href; a missing href disables its button. Here there is no previous cursor, so on the first page Previous is a disabled button and the keyboard skips it.

With summary

A line with the range and the total, and the page numbers at the end. Below the sm breakpoint the numbers are replaced by "Page 3 of 10" so the control fits a phone.

Sizes

Small (32 px), medium (40 px) and large (48 px). Medium is the same height as a medium button.