NAVIGATION
Pagination
Numbered page navigator with prev / next chevrons, ellipsis collapsing on long ranges, and localizable labels. The page-window math is exposed as computePageWindow if you need to compose your own UI.
Import
Basic usage
Long range — ellipsis collapsing
With many pages, Pagination shows the first / last / current window and inserts ellipsis between gaps.
Localised labels
Props
Pagination props
| Prop | Type | Default | Description |
|---|---|---|---|
| currentPage* | number | — | Active page (1-indexed). Drives aria-current on the matching button. |
| totalPages* | number | — | Total number of pages. |
| maxVisible | number | — | Maximum number of page buttons rendered between the ellipses. Defaults to a sensible window via computePageWindow (also exported). |
| onPageChange* | (page: number) => void | — | Fires when the user clicks a page number or the prev/next chevrons. |
| labels | Partial<PaginationLabels> | — | Override accessible labels — { previous, next, page, pageOf(page, total) }. Defaults are English. |
| disabled | boolean | — | Disables every button (useful while a parent fetch is in flight). |
Accessibility
- Wrapper is
<nav aria-label="Pagination">. - The current page button gets
aria-current="page"; all other page buttons get anaria-labellikePagina 3(localised vialabels.page). - Ellipses render
aria-hidden— they are not announced. - Keyboard: page numbers and the prev/next chevrons are native
<button>elements — Tab moves focus across them, Enter / Space activate them. Disabled buttons (prev at page 1, next at the last page) are skipped from the focus order automatically.