Pagination

To build in the app

Canon pagination from the catalog's rt-pagination, structured like Pagy's nav so the app can style it as a Pagy template. Info text left, prev/next and page numbers right; under sm the numbers hide and a compact current / total sits between the arrows. Renders nothing for a single page. Respellings from the catalog: text-sm is ui-sm; the gray 300/200 borders are stone-300/200, and Prev/Next's line is stone-400 with the other outlined controls since DES2-11 (2026-10-23). Prev/Next keep the catalog's text arrows.

App: Ui::PaginationComponent (Pagy nav template)

Page 5 of 25

#default

The catalog example: 247 items, 25 per page, a window of 2 either side of the current page.

101-125 of 247 results

First page

#first-page

Prev is disabled; no leading gap.

1-25 of 247 results

Last page

#last-page

Next is disabled; no trailing gap.

601-247 of 247 results

Three pages

#few-pages

Every page fits in the window, so there are no gaps.

26-50 of 62 results

No items

#no-items

items=0 swaps the info text for "No results found".

No results found

Single page

#single-page

total=1 renders nothing: a list that fits on one page shows no pagination.

1-12 of 12 results
(nothing rendered above this note)

With hrefs

#with-hrefs

href_for builds real links, as Pagy does in the app.

51-75 of 190 results

Stateful (mock)

#stateful

onPageChange keeps the page in local state so the nav can be clicked through. Mock behaviour only.

1-25 of 287 results

Props

NameTypeDefaultNotes
currentnumber—Required. Current page (1-based)
totalnumber—Required. Total pages; total <= 1 renders nothing
per_pagenumber25Items per page, for the info text
itemsnumber0Total item count; 0 shows "No results found"
windownumber2Pages shown either side of current before a gap
href_for(page: number) => string—Builds page hrefs; default links are href="#"
onPageChange(page: number) => void—Mock behaviour: page links become buttons. The app uses Pagy links instead
classNamestring—On the outer flex wrapper