React Pagination

Paging for parametric tables and long catalogs: numbered pages in a sibling window around the current page (edges always visible, gaps as ellipses), prev/next arrows, and — for tables — a monospaced "x–y of z" readout with a page-size select. Page numbers render in mono so the control doesn't shift width as you move through four-digit page counts.

Full table variant — sibling window, edges, row-count readout, and page size.

Minimal — five pages, no readout.

Installation

npx shadcn@latest add pagination.json

Usage

Loading...

Props

PropTypeDefaultDescription
pagenumberCurrent page (1-based)
pageCountnumberTotal pages
onPageChange(page: number) => voidPage selection
siblingCountnumber1Numbered buttons on each side of current
totalItemsnumberEnables the "x–y of z" readout (with pageSize)
pageSizenumberRows per page
pageSizeOptionsnumber[]Renders the page-size select
onPageSizeChange(size: number) => voidPage-size selection