What problem does it solve?
This skill solves the problem of building correct, user-friendly pagination for TanStack Table v9 data grids, whether the table paginates locally or relies on a server for paging.
Core Features & Use Cases
- Client-side pagination using the
paginatedRowModel stage with rowPaginationFeature and createPaginatedRowModel().
- Server-side pagination with
manualPagination, rowCount/pageCount, and onPaginationChange so navigation buttons reflect real totals.
- Accurate “total filtered” counts using
getPrePaginatedRowModel() to show counts after transforms but before the page slice.
Use case: you have a reusable datagrid that must support page controls, correct next/previous enablement, and consistent page size changes across both in-memory datasets and server-fetched results.
Quick Start
Create a TanStack table instance that includes the paginatedRowModel: createPaginatedRowModel() row model, initializes state.pagination with { pageIndex, pageSize }, and then call table.nextPage(), table.setPageIndex(), and table.setPageSize() from your pagination UI.