Client-side pagination
A browser-rendered table holds the complete dataset and needs page controls.
TanStack · Function
Creates the row-model factory used for client-side pagination in TanStack Table. It exposes only the rows belonging to the current page.
Calling getPaginationRowModel returns a row-model factory that applies client-side pagination to a table. Register that factory in the table options, then read the resulting paginated rows through the table's row-model API.
function getPaginationRowModel<TData>(): RowModelFactory<TData>;| Name | Type | Description |
|---|---|---|
TData | TData extends RowData | Generic row-data type extending RowData; the factory itself takes no runtime arguments. |
RowModelFactory<TData>
import { getCoreRowModel, getPaginationRowModel, useReactTable } from '@tanstack/react-table'
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
})
const visibleRows = table.getRowModel().rowsConfigure the factory on a table to derive the rows for the active pagination state.
A browser-rendered table holds the complete dataset and needs page controls.
Filtering, sorting, grouping, and expansion should complete before rows are divided into pages.
An existing useLegacyTable application needs the v8-style pagination option during migration.
It is a row-model factory that returns the table rows after client-side pagination has been applied. Register it as getPaginationRowModel: getPaginationRowModel() in the table configuration.
Follow-up: How does it fit into row-model processing? Pagination runs after filtering, grouping, sorting, and expanding, and before the final table row model.
Use the factory when the table performs pagination over the data it has locally. For server-side pagination, use manual pagination and omit this factory because the returned data is already paged.
Follow-up: What changes for server-side pagination? The table consumes the server-provided page and pagination state without applying a client-side pagination row model.
The documented signature is getPaginationRowModel?: (table: Table<TData>) => () => RowModel<TData> for the table option, while the factory call itself is getPaginationRowModel(). It produces the row model for the current page.
Follow-up: What is the newer API direction? In the latest migration guidance, useTable registers createPaginatedRowModel through tableFeatures rather than the legacy get*RowModel option.
getCoreRowModelgetFilteredRowModelgetGroupedRowModelgetSortedRowModelgetExpandedRowModelgetPrePaginationRowModelcreatePaginatedRowModelmanualPagination