Pagination
page is 1-based; onChange receives the new page. Add pageSizeOptions, pageSize and onPageSizeChange for a "Per page" select. Changing the size is up to you: usually go back to page 1 and recompute pageCount.
The buttons are 38px tall to line up with the per-page select, and Prev and Next share one width.
Props
pagenumberCurrent page (1-based).
pageCountnumberTotal number of pages.
onChange(page: number) => voidCalled with the new page.
siblingsnumberDefault:1Page numbers shown each side of the current page.
pageSizenumberCurrent items per page (shown in the per-page select).
pageSizeOptionsnumber[]Choices for the per-page select; the select shows only with
onPageSizeChangetoo.onPageSizeChange(size: number) => voidCalled with the chosen page size.
pageSizeLabelstringDefault:'Per page'Label of the per-page select.
classNamestringDefault:''Extra classes for the root element.
| Prop | Type | Default | Description |
|---|---|---|---|
page | number | – | Current page (1-based). |
pageCount | number | – | Total number of pages. |
onChange | (page: number) => void | – | Called with the new page. |
siblings | number | 1 | Page numbers shown each side of the current page. |
pageSize | number | – | Current items per page (shown in the per-page select). |
pageSizeOptions | number[] | – | Choices for the per-page select; the select shows only with onPageSizeChange too. |
onPageSizeChange | (size: number) => void | – | Called with the chosen page size. |
pageSizeLabel | string | 'Per page' | Label of the per-page select. |
className | string | '' | Extra classes for the root element. |