Demos

Pagination with previous and next links and an ellipsis.

Usage

Use pagination for long lists split across pages, such as past reports or invoices. It renders links, so each page can have its own URL.

Import it from @workspace/ui/components/pagination.

Anatomy

  • Pagination — The nav landmark, centred.
  • PaginationContent — The list of items.
  • PaginationItem — One list item.
  • PaginationLink — A page number. The active page gets an outline.
  • PaginationPrevious and PaginationNext — Arrow links. Their text hides on small screens.
  • PaginationEllipsis — Marks skipped pages.

Notes

  • The active link has aria-current="page".
  • Show the first and last pages and the ones around the current page. Replace the rest with an ellipsis.
  • The links have no disabled state. On the first or last page, hide the arrow or style it with aria-disabled, as in the controlled example.

Examples

Controlled

Keep the page in state and stop the links from navigating.

Props

Unlisted props pass through to the underlying element.

PropTypeDefaultDescription
hrefstring—Page URL.
isActivebooleanfalseMarks the current page.
sizeButton sizeiconSize of the link.

PaginationPrevious and PaginationNext

PropTypeDefaultDescription
hrefstring—URL of the previous or next page.
textstringPrevious or NextVisible text.