@tanstack/table-core 9.0.0-beta.37 → 9.0.0-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +1 -0
  2. package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
  3. package/dist/core/headers/buildHeaderGroups.d.cts +1 -1
  4. package/dist/core/headers/buildHeaderGroups.d.ts +1 -1
  5. package/dist/core/headers/buildHeaderGroups.js.map +1 -1
  6. package/dist/core/headers/coreHeadersFeature.utils.cjs +7 -7
  7. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  8. package/dist/core/headers/coreHeadersFeature.utils.js +7 -7
  9. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  10. package/dist/core/table/coreTablesFeature.utils.cjs +1 -1
  11. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  12. package/dist/core/table/coreTablesFeature.utils.js +1 -1
  13. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  14. package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +5 -5
  15. package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +5 -5
  16. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +6 -6
  17. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
  18. package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +3 -3
  19. package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +3 -3
  20. package/dist/features/column-ordering/columnOrderingFeature.utils.js +6 -6
  21. package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
  22. package/dist/features/column-pinning/columnPinningFeature.cjs +44 -39
  23. package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
  24. package/dist/features/column-pinning/columnPinningFeature.d.cts +6 -1
  25. package/dist/features/column-pinning/columnPinningFeature.d.ts +6 -1
  26. package/dist/features/column-pinning/columnPinningFeature.js +45 -40
  27. package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
  28. package/dist/features/column-pinning/columnPinningFeature.types.d.cts +49 -38
  29. package/dist/features/column-pinning/columnPinningFeature.types.d.ts +49 -38
  30. package/dist/features/column-pinning/columnPinningFeature.utils.cjs +154 -146
  31. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  32. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +81 -73
  33. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +81 -73
  34. package/dist/features/column-pinning/columnPinningFeature.utils.js +141 -133
  35. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  36. package/dist/features/column-sizing/columnSizingFeature.cjs +4 -4
  37. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  38. package/dist/features/column-sizing/columnSizingFeature.js +5 -5
  39. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  40. package/dist/features/column-sizing/columnSizingFeature.types.d.cts +18 -12
  41. package/dist/features/column-sizing/columnSizingFeature.types.d.ts +18 -12
  42. package/dist/features/column-sizing/columnSizingFeature.utils.cjs +24 -20
  43. package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
  44. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +18 -14
  45. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +18 -14
  46. package/dist/features/column-sizing/columnSizingFeature.utils.js +24 -20
  47. package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
  48. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +16 -16
  49. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
  50. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +3 -3
  51. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +3 -3
  52. package/dist/features/column-visibility/columnVisibilityFeature.utils.js +16 -16
  53. package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
  54. package/dist/static-functions.cjs +16 -16
  55. package/dist/static-functions.d.cts +3 -3
  56. package/dist/static-functions.d.ts +3 -3
  57. package/dist/static-functions.js +3 -3
  58. package/package.json +1 -1
  59. package/skills/api-not-found/SKILL.md +113 -0
  60. package/skills/client-vs-server/SKILL.md +164 -0
  61. package/skills/column-faceting/SKILL.md +91 -0
  62. package/skills/column-filtering/SKILL.md +82 -0
  63. package/skills/column-ordering/SKILL.md +75 -0
  64. package/skills/column-pinning/SKILL.md +89 -0
  65. package/skills/column-resizing/SKILL.md +91 -0
  66. package/skills/column-sizing/SKILL.md +72 -0
  67. package/skills/column-visibility/SKILL.md +75 -0
  68. package/skills/core/SKILL.md +140 -0
  69. package/skills/custom-features/SKILL.md +207 -0
  70. package/skills/expanding/SKILL.md +80 -0
  71. package/skills/global-filtering/SKILL.md +84 -0
  72. package/skills/grouping/SKILL.md +50 -394
  73. package/skills/migrate-v8-to-v9/SKILL.md +230 -390
  74. package/skills/pagination/SKILL.md +35 -344
  75. package/skills/row-pinning/SKILL.md +47 -238
  76. package/skills/row-selection/SKILL.md +39 -351
  77. package/skills/sorting/SKILL.md +35 -299
  78. package/skills/table-features/SKILL.md +153 -0
  79. package/skills/typescript/SKILL.md +126 -0
  80. package/src/core/headers/buildHeaderGroups.ts +1 -1
  81. package/src/core/headers/coreHeadersFeature.utils.ts +7 -7
  82. package/src/core/table/coreTablesFeature.utils.ts +1 -1
  83. package/src/features/column-ordering/columnOrderingFeature.types.ts +5 -5
  84. package/src/features/column-ordering/columnOrderingFeature.utils.ts +9 -9
  85. package/src/features/column-pinning/columnPinningFeature.ts +64 -59
  86. package/src/features/column-pinning/columnPinningFeature.types.ts +49 -38
  87. package/src/features/column-pinning/columnPinningFeature.utils.ts +163 -155
  88. package/src/features/column-sizing/columnSizingFeature.ts +6 -6
  89. package/src/features/column-sizing/columnSizingFeature.types.ts +18 -12
  90. package/src/features/column-sizing/columnSizingFeature.utils.ts +31 -27
  91. package/src/features/column-visibility/columnVisibilityFeature.utils.ts +15 -15
  92. package/skills/column-definitions/SKILL.md +0 -330
  93. package/skills/column-layout/SKILL.md +0 -326
  94. package/skills/column-layout/references/subsystems.md +0 -220
  95. package/skills/customizing-feature-behavior/SKILL.md +0 -423
  96. package/skills/filtering/SKILL.md +0 -375
  97. package/skills/filtering/references/faceting-and-fuzzy.md +0 -218
  98. package/skills/row-expanding/SKILL.md +0 -356
  99. package/skills/setup/SKILL.md +0 -390
  100. package/skills/state-management/SKILL.md +0 -403
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: core
3
+ description: >
4
+ Use TanStack Table v9 as a headless data-grid state and row-processing engine. Load for first-table architecture, stable data and columns, semantic rendering, framework adapter choice, or deciding what Table owns versus the renderer.
5
+ metadata:
6
+ type: core
7
+ library: '@tanstack/table-core'
8
+ library_version: '9.0.0-beta.42'
9
+ sources:
10
+ - 'TanStack/table:docs/overview.md'
11
+ - 'TanStack/table:docs/guide/tables.md'
12
+ - 'TanStack/table:docs/guide/data.md'
13
+ - 'TanStack/table:packages/table-core/src/index.ts'
14
+ ---
15
+
16
+ # TanStack Table Core
17
+
18
+ TanStack Table creates a table instance, state, and row models. It does not render a component, choose a component library, apply CSS, or supply interaction accessibility. Use a framework adapter in UI code; use `constructTable` only for framework-neutral integrations.
19
+
20
+ ## Setup
21
+
22
+ <!-- skill-snippet:check -->
23
+
24
+ ```ts
25
+ import {
26
+ constructTable,
27
+ createColumnHelper,
28
+ tableFeatures,
29
+ } from '@tanstack/table-core'
30
+ import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
31
+
32
+ type Person = { id: string; name: string }
33
+ const features = tableFeatures({
34
+ coreReactivityFeature: storeReactivityBindings(),
35
+ })
36
+ const helper = createColumnHelper<typeof features, Person>()
37
+ const columns = helper.columns([helper.accessor('name', { header: 'Name' })])
38
+ const data: Person[] = [{ id: '1', name: 'Ada' }]
39
+ const table = constructTable({
40
+ features,
41
+ columns,
42
+ data,
43
+ getRowId: (row) => row.id,
44
+ })
45
+
46
+ for (const row of table.getRowModel().rows) {
47
+ console.log(row.getAllCells().map((cell) => cell.getValue()))
48
+ }
49
+ ```
50
+
51
+ ## Core Patterns
52
+
53
+ ### Start with core, add only behavior used
54
+
55
+ ```ts
56
+ const features = tableFeatures({
57
+ coreReactivityFeature: storeReactivityBindings(),
58
+ })
59
+ ```
60
+
61
+ The core row model is automatic; filtering, sorting, pagination, and other optional behavior require their feature plugins.
62
+
63
+ ### Keep model inputs stable
64
+
65
+ ```ts
66
+ const data: Person[] = [{ id: '1', name: 'Ada' }]
67
+ const columns = helper.columns([helper.accessor('name', { header: 'Name' })])
68
+ ```
69
+
70
+ Define static inputs once and preserve query/store references when data has not changed.
71
+
72
+ ## Common Mistakes
73
+
74
+ ### [HIGH] Expecting Table to render a grid
75
+
76
+ Wrong:
77
+
78
+ ```ts
79
+ document.body.append(table as unknown as Node)
80
+ ```
81
+
82
+ Correct:
83
+
84
+ ```ts
85
+ const names = table
86
+ .getRowModel()
87
+ .rows.map((row) => row.getValue<string>('name'))
88
+ document.body.textContent = names.join(', ')
89
+ ```
90
+
91
+ The table instance is a model; markup, CSS, semantics, and accessibility are renderer responsibilities.
92
+
93
+ Source: `docs/overview.md`
94
+
95
+ ### [HIGH] Recreating model inputs repeatedly
96
+
97
+ Wrong:
98
+
99
+ ```ts
100
+ const options = () => ({
101
+ data: source.map((item) => item),
102
+ columns: helper.columns([]),
103
+ })
104
+ ```
105
+
106
+ Correct:
107
+
108
+ ```ts
109
+ const data = source.map((item) => item)
110
+ const columns = helper.columns([])
111
+ const options = () => ({ data, columns })
112
+ ```
113
+
114
+ New references invalidate memoized row and column work and can create adapter render loops.
115
+
116
+ Source: `docs/guide/data.md`
117
+
118
+ ### [HIGH] Detaching prototype-bound methods
119
+
120
+ Wrong:
121
+
122
+ ```ts
123
+ const { getValue } = table.getRowModel().rows[0]!
124
+ getValue('name')
125
+ ```
126
+
127
+ Correct:
128
+
129
+ ```ts
130
+ const row = table.getRowModel().rows[0]!
131
+ row.getValue('name')
132
+ ```
133
+
134
+ V9 row, cell, column, and header methods use their instance as `this`.
135
+
136
+ Source: `docs/framework/react/guide/migrating.md#instance-methods-must-be-called-on-their-instance`
137
+
138
+ ## API Discovery
139
+
140
+ Inspect `node_modules/@tanstack/table-core/src/index.ts`, then follow the exported implementation. For UI creation and rendering, inspect `node_modules/@tanstack/<framework>-table/src/index.ts` and load that adapter's getting-started skill.
@@ -0,0 +1,207 @@
1
+ ---
2
+ name: custom-features
3
+ description: >
4
+ Author a TanStack Table v9 feature plugin across every FeatureMap and API installation surface: state, options, column definitions, table, column, row, cell, header, row-model functions/caches, defaults, prototypes, and instance data. Load only for reusable behavior not covered by built-ins, meta, or option composition.
5
+ metadata:
6
+ type: sub-skill
7
+ library: '@tanstack/table-core'
8
+ library_version: '9.0.0-beta.42'
9
+ requires: ['core', 'table-features', 'typescript']
10
+ sources:
11
+ - 'TanStack/table:docs/framework/react/guide/custom-features.md'
12
+ - 'TanStack/table:packages/table-core/src/types'
13
+ - 'TanStack/table:packages/table-core/src/types/TableFeatures.ts'
14
+ - 'TanStack/table:packages/table-core/src/utils.ts'
15
+ - 'TanStack/table:packages/table-core/src/features'
16
+ - 'TanStack/table:examples/react/custom-plugin'
17
+ ---
18
+
19
+ This skill builds on `core`, `table-features`, and `typescript`. Prefer a built-in feature or typed `tableMeta`/`columnMeta` for application callbacks; create a feature only for reusable state or behavior that must augment Table objects.
20
+
21
+ ## Extension Surface
22
+
23
+ Declaration-merge `Plugins` to register the feature key, then merge only the maps backed by runtime behavior:
24
+
25
+ | Feature map | Contribution |
26
+ | ------------------------------------------------ | ----------------------------------------- |
27
+ | `TableState_FeatureMap` | State slices in options, atoms, and store |
28
+ | `TableOptions_FeatureMap<TFeatures, TData>` | Table options and change callbacks |
29
+ | `Table_FeatureMap<TFeatures, TData>` | Public table APIs |
30
+ | `ColumnDef_FeatureMap<TFeatures, TData, TValue>` | Column-definition options |
31
+ | `Column_FeatureMap<TFeatures, TData>` | Public column APIs/data |
32
+ | `Row_FeatureMap<TFeatures, TData>` | Public row APIs/data |
33
+ | `Cell_FeatureMap` | Public cell APIs |
34
+ | `Header_FeatureMap` | Public header APIs |
35
+ | `RowModelFns_FeatureMap<TFeatures, TData>` | Advanced `table._rowModelFns` registries |
36
+ | `CachedRowModels_FeatureMap<TFeatures, TData>` | Advanced `table._rowModels` cache getters |
37
+
38
+ `assignTableAPIs` installs singleton table methods. Use `assignPrototypeAPIs` inside `assignColumnPrototype`, `assignRowPrototype`, `assignCellPrototype`, or `assignHeaderPrototype` for shared object methods. Use `initColumnInstanceData` and `initRowInstanceData` only for per-instance fields.
39
+
40
+ ## Complete Example
41
+
42
+ This single example shows every ordinary FeatureMap and API installation path. It names the two advanced row-model maps without enabling them because density does not own the row-model pipeline.
43
+
44
+ <!-- skill-snippet:check -->
45
+
46
+ ```ts
47
+ import {
48
+ assignPrototypeAPIs,
49
+ assignTableAPIs,
50
+ functionalUpdate,
51
+ makeStateUpdater,
52
+ tableFeatures,
53
+ type CellData,
54
+ type OnChangeFn,
55
+ type RowData,
56
+ type TableFeature,
57
+ type TableFeatures,
58
+ type Updater,
59
+ } from '@tanstack/table-core'
60
+
61
+ type Density = 'sm' | 'md'
62
+ interface DensityState {
63
+ density: Density
64
+ }
65
+ interface DensityOptions {
66
+ onDensityChange?: OnChangeFn<Density>
67
+ }
68
+ interface DensityColumnDef {
69
+ enableDensity?: boolean
70
+ }
71
+ interface DensityAPI {
72
+ getDensity: () => Density
73
+ }
74
+ interface DensityTable extends DensityAPI {
75
+ setDensity: (updater: Updater<Density>) => void
76
+ }
77
+ interface DensityColumn extends DensityAPI {
78
+ densityAtCreation?: Density
79
+ }
80
+ interface DensityRow extends DensityAPI {
81
+ densityAtCreation?: Density
82
+ }
83
+ type DensityCell = DensityAPI
84
+ type DensityHeader = DensityAPI
85
+
86
+ declare module '@tanstack/table-core' {
87
+ interface Plugins {
88
+ densityFeature: TableFeature
89
+ }
90
+ interface TableState_FeatureMap {
91
+ densityFeature: DensityState
92
+ }
93
+ interface TableOptions_FeatureMap<
94
+ TFeatures extends TableFeatures,
95
+ TData extends RowData,
96
+ > {
97
+ densityFeature: DensityOptions
98
+ }
99
+ interface Table_FeatureMap<
100
+ TFeatures extends TableFeatures,
101
+ TData extends RowData,
102
+ > {
103
+ densityFeature: DensityTable
104
+ }
105
+ interface ColumnDef_FeatureMap<
106
+ TFeatures extends TableFeatures,
107
+ TData extends RowData,
108
+ TValue extends CellData,
109
+ > {
110
+ densityFeature: DensityColumnDef
111
+ }
112
+ interface Column_FeatureMap<
113
+ TFeatures extends TableFeatures,
114
+ TData extends RowData,
115
+ > {
116
+ densityFeature: DensityColumn
117
+ }
118
+ interface Row_FeatureMap<
119
+ TFeatures extends TableFeatures,
120
+ TData extends RowData,
121
+ > {
122
+ densityFeature: DensityRow
123
+ }
124
+ interface Cell_FeatureMap {
125
+ densityFeature: DensityCell
126
+ }
127
+ interface Header_FeatureMap {
128
+ densityFeature: DensityHeader
129
+ }
130
+
131
+ // If this feature actually owned a row-model stage, it would also merge
132
+ // RowModelFns_FeatureMap and CachedRowModels_FeatureMap here, then populate
133
+ // table._rowModelFns/table._rowModels with matching runtime/cache wiring.
134
+ }
135
+
136
+ const readDensity = (table: unknown): Density =>
137
+ (
138
+ table as {
139
+ atoms: { density: { get: () => Density } }
140
+ }
141
+ ).atoms.density.get()
142
+
143
+ export const densityFeature: TableFeature = {
144
+ getInitialState: (state) => ({ density: 'md', ...state }),
145
+ getDefaultTableOptions: (table) => ({
146
+ onDensityChange: makeStateUpdater('density', table),
147
+ }),
148
+ constructTableAPIs: (table) => {
149
+ assignTableAPIs('densityFeature', table, {
150
+ table_getDensity: { fn: () => readDensity(table) },
151
+ table_setDensity: {
152
+ fn: (updater: Updater<Density>) =>
153
+ (table.options as DensityOptions).onDensityChange?.((old) =>
154
+ functionalUpdate(updater, old),
155
+ ),
156
+ },
157
+ })
158
+ },
159
+ assignColumnPrototype: (prototype, table) => {
160
+ assignPrototypeAPIs('densityFeature', prototype, table, {
161
+ column_getDensity: { fn: (column) => readDensity(column.table) },
162
+ })
163
+ },
164
+ assignRowPrototype: (prototype, table) => {
165
+ assignPrototypeAPIs('densityFeature', prototype, table, {
166
+ row_getDensity: { fn: (row) => readDensity(row.table) },
167
+ })
168
+ },
169
+ assignCellPrototype: (prototype, table) => {
170
+ assignPrototypeAPIs('densityFeature', prototype, table, {
171
+ cell_getDensity: { fn: (cell) => readDensity(cell.table) },
172
+ })
173
+ },
174
+ assignHeaderPrototype: (prototype, table) => {
175
+ assignPrototypeAPIs('densityFeature', prototype, table, {
176
+ header_getDensity: { fn: (header) => readDensity(header.table) },
177
+ })
178
+ },
179
+ initColumnInstanceData: (column) => {
180
+ ;(column as unknown as DensityColumn).densityAtCreation = readDensity(
181
+ column.table,
182
+ )
183
+ },
184
+ initRowInstanceData: (row) => {
185
+ ;(row as unknown as DensityRow).densityAtCreation = readDensity(row.table)
186
+ },
187
+ }
188
+
189
+ export const features = tableFeatures({ densityFeature })
190
+ ```
191
+
192
+ `getDefaultColumnDef` is also available for overridable column defaults; add it when the feature owns a real column-definition default. Do not add lifecycle hooks merely to fill the surface.
193
+
194
+ ## Guardrails
195
+
196
+ - Keep the feature object and `tableFeatures({ densityFeature })` result stable.
197
+ - Match every declaration-merged API with runtime installation. Types alone do nothing.
198
+ - Preserve incoming state in `getInitialState`; put user state after defaults.
199
+ - Method keys use `table_`, `column_`, `row_`, `cell_`, or `header_`; the prefix is removed on installation.
200
+ - Table API `fn` receives declared arguments. Prototype API `fn` receives the current object first.
201
+ - Add `memoDeps` only for a genuinely derived method. Prototype methods are shared and must not close over per-object mutable data.
202
+ - There are no `assignColumnAPIs`, `assignRowAPIs`, `assignCellAPIs`, or `assignHeaderAPIs`; use `assignPrototypeAPIs` in the matching hook.
203
+ - Do not mutate constructed instances ad hoc or use a feature for renderer-only callbacks that belong in meta.
204
+
205
+ ## API Discovery
206
+
207
+ Inspect exported `*_FeatureMap` interfaces under `node_modules/@tanstack/table-core/src/types/`, `TableFeature` in `types/TableFeatures.ts`, and `assignTableAPIs`/`assignPrototypeAPIs` in `utils.ts`. Copy lifecycle shapes—not domain behavior—from the nearest stock feature under `src/features/`.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: expanding
3
+ description: >
4
+ Expand hierarchical subrows or custom detail panels with rowExpandingFeature, expandedRowModel, getSubRows, getRowCanExpand, manualExpanding, and paginateExpandedRows. Load when expansion state changes but no UI appears.
5
+ metadata:
6
+ {
7
+ type: sub-skill,
8
+ library: '@tanstack/table-core',
9
+ library_version: '9.0.0-beta.42',
10
+ }
11
+ requires: ['core', 'table-features', 'client-vs-server']
12
+ sources:
13
+ - 'TanStack/table:docs/framework/react/guide/expanding.md'
14
+ - 'TanStack/table:packages/table-core/src/features/row-expanding'
15
+ - 'TanStack/table:examples/react/expanding'
16
+ ---
17
+
18
+ This skill builds on `core`, `table-features`, and `client-vs-server`. Expansion controls row-tree inclusion; the renderer owns disclosure controls and detail panels.
19
+
20
+ ## Setup
21
+
22
+ ```ts
23
+ import {
24
+ createExpandedRowModel,
25
+ rowExpandingFeature,
26
+ tableFeatures,
27
+ } from '@tanstack/table-core'
28
+
29
+ type Node = { id: string; children?: Node[] }
30
+ export const features = tableFeatures({
31
+ rowExpandingFeature,
32
+ expandedRowModel: createExpandedRowModel(),
33
+ })
34
+ export const options = { getSubRows: (row: Node) => row.children }
35
+ ```
36
+
37
+ ## Core Patterns
38
+
39
+ ```ts
40
+ const detailOptions = { getRowCanExpand: () => true }
41
+ const isDetailOpen = row.getIsExpanded()
42
+ ```
43
+
44
+ For custom detail UI, render an additional row/panel when `isDetailOpen` is true.
45
+
46
+ ## Common Mistakes
47
+
48
+ ### [HIGH] Omitting the subrow accessor
49
+
50
+ Wrong: `const options = { data: nestedRows }`
51
+
52
+ Correct: `const options = { data: nestedRows, getSubRows: (row: Node) => row.children }`
53
+
54
+ Nested object structure is not inferred automatically.
55
+
56
+ Source: `docs/framework/react/guide/expanding.md#table-rows-as-expanded-data`
57
+
58
+ ### [HIGH] Expecting detail markup from state
59
+
60
+ Wrong: `row.toggleExpanded(true)`
61
+
62
+ Correct: `if (row.getIsExpanded()) renderDetail(row.original)`
63
+
64
+ Table is headless and cannot render a custom detail panel.
65
+
66
+ Source: `docs/framework/react/guide/expanding.md#custom-expanding-ui`
67
+
68
+ ### [HIGH] Misreading pagination placement
69
+
70
+ Wrong: `const options = { paginateExpandedRows: false }; const leafOnlyPages = true`
71
+
72
+ Correct: `const options = { paginateExpandedRows: false }; const descendantsStayWithParent = true`
73
+
74
+ This option controls whether expansion happens before or after pagination; it does not make page size count only leaf rows.
75
+
76
+ Source: `packages/table-core/src/features/row-expanding/rowExpandingFeature.types.ts`
77
+
78
+ ## API Discovery
79
+
80
+ Inspect `node_modules/@tanstack/table-core/src/features/row-expanding/` for expansion state, row APIs, and model placement.
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: global-filtering
3
+ description: >
4
+ Apply globalFilter across eligible columns with globalFilteringFeature, columnFilteringFeature, filteredRowModel, globalFilterFn, and manual server filtering. Load when columns unexpectedly participate or a global filter changes state without changing rows.
5
+ metadata:
6
+ {
7
+ type: sub-skill,
8
+ library: '@tanstack/table-core',
9
+ library_version: '9.0.0-beta.42',
10
+ }
11
+ requires: ['core', 'table-features', 'client-vs-server', 'column-filtering']
12
+ sources:
13
+ - 'TanStack/table:docs/framework/react/guide/global-filtering.md'
14
+ - 'TanStack/table:packages/table-core/src/features/global-filtering'
15
+ - 'TanStack/table:examples/react/filters'
16
+ ---
17
+
18
+ This skill builds on `core`, `table-features`, `client-vs-server`, and `column-filtering`. Global filtering reuses the column-filtering pipeline.
19
+
20
+ ## Setup
21
+
22
+ ```ts
23
+ import {
24
+ columnFilteringFeature,
25
+ createFilteredRowModel,
26
+ filterFns,
27
+ globalFilteringFeature,
28
+ tableFeatures,
29
+ } from '@tanstack/table-core'
30
+
31
+ export const features = tableFeatures({
32
+ columnFilteringFeature,
33
+ globalFilteringFeature,
34
+ filteredRowModel: createFilteredRowModel(),
35
+ filterFns,
36
+ })
37
+ ```
38
+
39
+ ## Core Patterns
40
+
41
+ ```ts
42
+ const options = {
43
+ globalFilterFn: 'includesString' as const,
44
+ getColumnCanGlobalFilter: (column) => column.id !== 'actions',
45
+ }
46
+ ```
47
+
48
+ Declare eligibility when product rules differ from default primitive-value detection.
49
+
50
+ ## Common Mistakes
51
+
52
+ ### [CRITICAL] Omitting column-filter prerequisite
53
+
54
+ Wrong: `tableFeatures({ globalFilteringFeature })`
55
+
56
+ Correct: `tableFeatures({ columnFilteringFeature, globalFilteringFeature, filteredRowModel: createFilteredRowModel() })`
57
+
58
+ Global filtering depends on column filtering and needs the filtered model for client processing.
59
+
60
+ Source: `packages/table-core/src/types/TableFeatures.ts#FeatureSlotPrereqs`
61
+
62
+ ### [HIGH] Assuming every column participates
63
+
64
+ Wrong: `const options = { globalFilterFn: 'includesString' }`
65
+
66
+ Correct: `const options = { getColumnCanGlobalFilter: column => column.id !== 'actions' }`
67
+
68
+ Default eligibility uses the first core row and accepts string or number values.
69
+
70
+ Source: `packages/table-core/src/features/global-filtering/globalFilteringFeature.ts`
71
+
72
+ ### [HIGH] Keeping manual filter local only
73
+
74
+ Wrong: `table.setGlobalFilter(search); const options = { manualFiltering: true }`
75
+
76
+ Correct: `const page = await fetchRows({ search }); const options = { data: page.rows, manualFiltering: true }`
77
+
78
+ Manual filtering bypasses the client model, so the value must drive the server request.
79
+
80
+ Source: `docs/framework/react/guide/global-filtering.md#manual-server-side-global-filtering`
81
+
82
+ ## API Discovery
83
+
84
+ Inspect `node_modules/@tanstack/table-core/src/features/global-filtering/` plus `src/features/column-filtering/` for shared state and filter functions.