Pagination
To build in the appCanon 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
#defaultThe catalog example: 247 items, 25 per page, a window of 2 either side of the current page.
First page
#first-pagePrev is disabled; no leading gap.
Last page
#last-pageNext is disabled; no trailing gap.
Three pages
#few-pagesEvery page fits in the window, so there are no gaps.
No items
#no-itemsitems=0 swaps the info text for "No results found".
Single page
#single-pagetotal=1 renders nothing: a list that fits on one page shows no pagination.
With hrefs
#with-hrefshref_for builds real links, as Pagy does in the app.
Stateful (mock)
#statefulonPageChange keeps the page in local state so the nav can be clicked through. Mock behaviour only.
Props
| Name | Type | Default | Notes |
|---|---|---|---|
| current | number | — | Required. Current page (1-based) |
| total | number | — | Required. Total pages; total <= 1 renders nothing |
| per_page | number | 25 | Items per page, for the info text |
| items | number | 0 | Total item count; 0 shows "No results found" |
| window | number | 2 | Pages 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 |
| className | string | — | On the outer flex wrapper |