
Description
Paginate with rowPaginationFeature and paginatedRowModel or manualPagination. Load for pageIndex/pageSize state, rowCount/pageCount, unknown next-page limits, already-paginated server data, or autoResetPageIndex surprises.
SKILL.md
This skill builds on core, table-features, and client-vs-server. Choose client slicing or server pages, never both accidentally.
Setup
import {
createPaginatedRowModel,
rowPaginationFeature,
tableFeatures,
} from '@tanstack/table-core'
export const features = tableFeatures({
rowPaginationFeature,
paginatedRowModel: createPaginatedRowModel(),
})
export const initialState = { pagination: { pageIndex: 0, pageSize: 25 } }
Core Patterns
const serverOptions = { manualPagination: true, rowCount: response.total }
Pass one already-processed page and either rowCount or pageCount.
Common Mistakes
CRITICAL Expecting manual mode to slice
Wrong: const options = { data: allRows, manualPagination: true }
Correct: const options = { data: requestedPageRows, manualPagination: true, rowCount: totalRows }
Manual pagination trusts the provided data as the current page.
Source: https://github.com/TanStack/table/issues/4917
HIGH Omitting the server total
Wrong: const options = { data: pageRows, manualPagination: true }
Correct: const options = { data: pageRows, manualPagination: true, rowCount: 1234 }
Without a count, last-page and next-page availability cannot reflect the server dataset.
Source: packages/table-core/src/features/row-pagination/rowPaginationFeature.types.ts
HIGH Fighting automatic page resets
Wrong: onPaginationChange: setPagination
Correct: const options = { onPaginationChange: setPagination, autoResetPageIndex: false }
Client data and processing changes may reset page index; configure the policy when product state must retain it.
Source: docs/framework/react/guide/pagination.md#auto-reset-page-index
API Discovery
Inspect node_modules/@tanstack/table-core/dist/features/row-pagination/ for reset rules, count calculation, and navigation APIs.
More skills from the table repository
View all 30 skillsaggregation
perform data aggregation in TanStack Table
Jul 26Data AnalysisFrontendTanStackapi-not-found
diagnose TanStack Table API errors
Jul 26DebuggingFrontendTanStackcell-selection
select rectangular cell ranges in tables
Jul 26Data AnalysisTanStackUI Componentsclient-vs-server
manage TanStack Table data pipelines
Jul 26Data PipelineFrontendPerformanceTanStackcolumn-faceting
build faceted filter UIs
Jul 26Data VisualizationFrontendTanStackcolumn-filtering
implement column filtering in TanStack Table
Jul 26Data AnalysisFrontendTanStack
More from TanStack
View publishercolumn-ordering
manage TanStack Table column ordering
table
Jul 26FrontendTanStackUI Componentscolumn-pinning
configure column pinning in TanStack Table
table
Jul 26CSSFrontendTanStackUI Componentscolumn-resizing
implement column resizing in TanStack Table
table
Jul 26FrontendTanStackUI Componentscolumn-sizing
configure column sizing in TanStack Table
table
Jul 26CSSFrontendTanStackUI Componentscolumn-visibility
manage column visibility in TanStack Table
table
Jul 26FrontendTanStackUI Componentscore
build data grids with TanStack Table
table
Jul 26Data AnalysisFrontendUI Components