Rime

Pagination

Centred page buttons with previous and next, gaps for long ranges, and a summary line at the left.

Pagination is the pager that sits under every Table, documented on its own because it works under any list: cards, search results, an activity feed. The page buttons stay on the centre line whatever the summary's length (a 1fr auto 1fr grid), and long ranges collapse into gaps around the current page.

With totalItems and pageSize it says "Showing 41 to 60 of 236 orders"; without, "Page 3 of 12". It is presentational: the screen owns the page number.

Usage

import { Pagination } from "@/components/ui";

<Pagination page={page} pageCount={12} onPageChange={setPage} totalItems={236} pageSize={20} itemLabel="orders" />

Examples

With a summary

Pages only

API

Generated from the component's TypeScript types and JSDoc (scripts/gen-ui-registry.mjs), so it always matches the source.

Pagination

Pagination props
PropTypeDefaultDescription
pageRequirednumber
pageCountRequirednumber
onPageChangeRequired(page: number) => void
totalItemsnumber
pageSizenumber
itemLabelstring"results"Plural noun for the summary: "customers", "requests".
classNamestring

Theme tokens

Per-component tokens are undeclared by default, so the default shown is the fallback the CSS uses. Set one at :root (or in theme.css) to restyle every instance. Live values are read from this page, so they follow the Rime Studio.

Pagination per-component tokens
TokenDefaultLive value
--button-primary-bgvar(--brand-gradient)…
--button-radiusvar(--r-sm)…
--inner-radiusvar(--r-lg)…
--r-flatvar(--table-radius, var(--r-md)) / var(--table-radius, var(--inner-radius, var(--r-lg)))…
--table-radiusvar(--r-md) / var(--inner-radius, var(--r-lg))…
--table-row-height46px…

System tokens it reads

Pagination system tokens
TokenDefaultLive value
--brand-deeptokens.css…
--brand-gradienttokens.css…
--control-h-smtokens.css…
--durtokens.css…
--easetokens.css…
--focus-colortokens.css…
--focus-ringtokens.css…
--font-monotokens.css…
--glass-fill-nestedtokens.css…
--glow-smtokens.css…
--ink-bodytokens.css…
--ink-brandtokens.css…
--ink-disabledtokens.css…
--ink-inversetokens.css…
--ink-mutedtokens.css…
--line-glasstokens.css…
--line-softtokens.css…
--r-lgtokens.css…
--r-mdtokens.css…
--r-smtokens.css…
--rgb-contacttokens.css…
--surface-solidtokens.css…
--table-cell-padtokens.css…
--table-head-filltokens.css…
--table-head-hovertokens.css…
--table-head-inktokens.css…
--table-head-padtokens.css…
--table-head-presstokens.css…
--table-head-ruletokens.css…
--table-row-hovertokens.css…
--table-row-linetokens.css…
--text-captiontokens.css…
--text-smalltokens.css…
--wash-subtletokens.css…

Accessibility

  • A nav labelled "Pagination"; the current page button has aria-current="page"; every button is named "Page n".
  • Previous and next disable at the ends rather than disappearing, so the layout never jumps.
  • The summary is a polite live region, so a page change is announced.

Do and don't

Do

  • Reset to page one when a filter or sort changes.
  • Keep it centred under the list it pages.

Don't

  • Don't left-align the page buttons.
  • Don't use infinite scroll for records people need to find again.

For AI agents

This page as markdown, rendered from the same registry entry. Point an agent at it (or add .md to this page's URL), or at /llms.txt for the index.

Open pagination.md

Related: table, filter-bar