ui-kit0.0

Navigation

Pagination

Move through long collections.

Usage

Compose the control from PaginationLinks and let usePagination decide which numbers and ellipses to show. The list keeps the same length while you page, so the control never changes width.

Showing 51 to 60 of 117 invoices

When to use

  • Collections where people look for a specific position: invoices, search results, logs.
  • Server-paged data, where each page is a URL (use links, so it can be shared and crawled).

Not for: feeds (infinite scroll or “Load more”), or fewer than two pages of results.

Compact

When space is short, replace the numbers with PaginationStatus: “Page 3 of 12”. On phones, Previous and Next also collapse to arrows.

As links

Give PaginationLink an href for a plain anchor, or use asChild with a Next.js Link. The pure function getPaginationRange works on the server.

API

usePagination(options)

PropTypeDefaultDescription
pagenumber—Current page, 1-based.
totalnumber—Number of pages.
siblingsnumber1Pages on each side of the current one.
boundariesnumber1Pages always shown at each end.

Returns an array of page numbers and the strings 'ellipsis-start' / 'ellipsis-end'.

PaginationLink

PropTypeDefaultDescription
isActivebooleanfalseThe current page: aria-current="page" and the filled style.
disabledbooleanfalseFirst / last page: stays in the layout, ignores clicks.
hrefstring—Renders an anchor. Without it the link is a button.
size'icon' | 'default''icon'Square for numbers, wide for Previous / Next.
asChildbooleanfalseRender the child element (e.g. Next.js Link).

PaginationPrevious and PaginationNext take the same props with an arrow and a label. PaginationStatus takes page and total.

Keyboard

KeyAction
TabMoves between the links; disabled ones are skipped.
EnterGoes to the page.
SpaceGoes to the page (buttons).

Accessibility

  • A nav landmark labelled “Pagination” holding a list. The current page has aria-current="page".
  • Give page numbers an aria-label such as “Page 6”; Previous and Next are labelled for you.
  • The status text is a polite live region, so a page change is announced.

Motion

  • Presses scale to .97 on the snappy spring; colours change in 150ms.
  • Reduced motion drops the press scale.