Pagination
A paged table's footer: the range showing, rows per page and the pages.
import { Pagination } from "@arcadia/ui"The parent owns page (from 0) and pageSize; the control reads the range from total and never shows a page past the last. Pass onPageSizeChange for the Rows picker and reset to the first page when it changes. Name a row with noun so the range says what it counts. Every paged table uses this one footer, so paging reads and works the same everywhere.
Examples
A navigation landmark named by label ("Pages" by default). Previous and Next are named buttons that disable at the ends rather than vanish, so focus never jumps. The range is a polite live region: changing the page or the rows per page announces the new range. The Rows picker is a segmented control with arrow-key focus.
Pagination
pagerequired- number
- The current page, from 0. Out of range reads as the last page.
pageSizerequired- number
- Rows per page.
totalrequired- number
- Every row there is, across pages.
onPageChangerequired- (page: number) => void
pageSizes- readonly number[]Default[10, 25, 50]
- The row-count choices; with
onPageSizeChange, a "Rows" picker appears. onPageSizeChange- (size: number) => void
noun- readonly [one: string, many: string]Default["row", "rows"]
- What a row is, singular and plural, for the range ("1 to 10 of 351 turns"). Default:
row. label- stringDefault"Pages"
- Names the navigation landmark. Default: "Pages".
rootStyle- PaginationStyle
- Pagination has no knobs of its own: place it with
rootStyle.
Rest props go to HTMLAttributes<HTMLElement>.