Agents & OrchestrationSûr100100/100

Pagination (TanStack)

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.

ou envoie-le directement à ton agent.

Installer dans ton projet

$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs pagination__tanstack-table__packages-table-core-skills-0b5fb220ee7b
TanStack
TanStack/table
Contenu à copier
---
name: pagination
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.
metadata:
  origin: TanStack
  { type: sub-skill, library: '@tanstack/table-core', library_version: '9.2.4' }
requires: ['core', 'table-features', 'client-vs-server']
sources:
  - 'TanStack/table:docs/framework/react/guide/pagination.md'
  - 'TanStack/table:packages/table-core/src/features/row-pagination'
  - 'TanStack/table:examples/react/pagination'
---

This skill builds on `core`, `table-features`, and `client-vs-server`. Choose client slicing or server pages, never both accidentally.

## Setup

```ts
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

```ts
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.
Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.

Ce que fait Pagination (TanStack)

Applique les pratiques du skill pagination__tanstack-table__packages-table-core-skills-0b5fb220ee7b.

Comment utiliser Pagination (TanStack)

1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.

Déclencheurs pour Pagination (TanStack)

Dis simplement à ton agent quelque chose comme :

Applique le skill pagination__tanstack-table__packages-table-core-skills-0b5fb220ee7b à cette tâche
Utilise pagination__tanstack-table__packages-table-core-skills-0b5fb220ee7b pour améliorer cette implémentation
Passe en revue ce sujet avec pagination__tanstack-table__packages-table-core-skills-0b5fb220ee7b

Skills liés à Pagination (TanStack)