Skip to content
Protocore Design Systemv1.6.9

/// Navigation

Pagination

Page navigation — a mono button row. Numbered mode draws pages with ellipses and an inverted current page; cursor mode draws prev/next only.

import { Pagination } from "@protocore/pds";
View as Markdown

Numbered (known total)

Pass pageCount for a fully numbered row. The current page inverts to a solid fill, and long ranges collapse to ellipses. Emit changes through onPageChange.

Showing settlements 5175 of 300.

Cursor (unknown total)

Omit pageCount and pass hasPrev / hasNext for keyset-paginated data where the server never returns a total — you only know whether another page exists.

Message log — page 1

Wide ranges

siblingCount controls how many pages flank the current one before the range collapses. First and last pages always stay visible.

When to use it

Use Pagination to move through pages of a list or table under a fixed page size.

  • Know the total count? Use numbered mode (pageCount) so users can jump directly and see how far they are.
  • Backed by a cursor / keyset API with no cheap total? Use cursor mode (hasPrev/hasNext) — never fake a page count.
  • Prefer infinite scroll for exploratory feeds; keep Pagination for addressable, bookmarkable pages (search results, ledgers, logs).
  • It pairs naturally under a DataTable or ListingRow list.

Usage

Do

  • Use cursor mode (hasPrev/hasNext) whenever the total is unknown or expensive to compute.
  • Keep page size fixed while paging so offsets stay meaningful.
  • Reflect the current page in the URL so a page is shareable and back-button-safe.
  • Disable PREV/NEXT at the ends rather than hiding them, so the control's width is stable.

Don't

  • Don't invent a pageCount you don't have just to show numbers.
  • Don't reset to page 1 silently when a filter changes without telling the user.
  • Don't stack Pagination with infinite scroll on the same list.
  • Don't raise siblingCount so high the row overflows on mobile.

Accessibility

KeysAction
TabMove focus across PREV, the page buttons, and NEXT
Enter / SpaceActivate the focused page button
  • The root is a `<nav aria-label="Pagination">` landmark; override the name with `aria-label` when several paginators share a page.
  • The current page button carries `aria-current="page"`; PREV / NEXT have explicit `aria-label`s and are `disabled` at the ends.

Pagination props

PropTypeDefaultDescription
aria-labelstringAccessible name for the nav landmark. Default "Pagination".
classNamestring
hasNextbooleanCursor mode: whether a next page exists. Ignored when `pageCount` is set.
hasPrevbooleanCursor mode: whether a previous page exists. Ignored when `pageCount` is set.
onPageChange((page: number) => void)Called with the requested 1-based page.
page *numberCurrent page, 1-based.
pageCountnumberTotal page count. Omit for cursor mode (prev/next only).
siblingCountnumber1Numbered mode: pages to keep either side of the current page. Default 1.
styleCSSProperties

Related

  • DataTableThe server-driven console workhorse — TanStack v8 in manual mode with sorting, pagination, selection, and five body states.
  • BreadcrumbBreadcrumb trail — a mono UPPERCASE, "/"-separated path where crumbs are links and the last is the inked current page.
  • FilterBarA wrapping row of filter chips above a grid or list; selects one value or many, with an optional mono eyebrow.
  • StepsStepper — an ordered list of [ 0N ]-marked steps joined by hairline connectors, with done / active / pending states. Vertical or horizontal.