mcpField
T
tanstack-table

tanstack-table

github.com/oakossDevelopment20140 installsUpdated 11w ago
Repository

About tanstack-table

TanStack Table is a headless table library for developers who need custom-rendered data tables. It provides table state and logic for sorting, filtering, pagination, selection, grouping, and more.

Key features

  1. 01Headless table state and logic
  2. 02Sorting, filtering, and pagination
  3. 03Row selection and expansion
  4. 04Grouping and column controls
  5. 05Server-side data patterns
  6. 06Virtualization integration

Use cases

  1. 01Building custom data tables
  2. 02Displaying server-paginated results
  3. 03Handling large datasets with virtualization

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/oakoss/agent-skills --skill tanstack-table

After installing, type/tanstack-tablein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
column-definitions.md
column-row-pinning.md
expanding-grouping.md
filtering.md
infinite-scroll.md
known-issues.md
reusable-components.md
server-side-patterns.md
v7-migration.md
virtualization.md

Details

From the project README

TanStack Table

Overview

TanStack Table is a headless table library — it provides state management and logic but no UI. You supply the rendering; it handles sorting, filtering, pagination, selection, and more.

When to use: Complex data tables with sorting/filtering/pagination, server-side data, large datasets (1000+ rows with virtualization), row selection/expanding/grouping.

When NOT to use: Simple static tables (use <table> directly), display-only lists (use a list component), spreadsheet-like editing (consider AG Grid).

Quick Reference

PatternAPI / ConfigKey Points
Basic tableuseReactTable({ data, columns, getCoreRowModel })Memoize data/columns to prevent re-renders
Column helpercreateColumnHelper<T>()Type-safe column definitions
Column groupscolumnHelper.group({ header, columns })Nested headers; don't pin group columns
SortinggetSortedRowModel() + onSortingChangemanualSorting: true for server-side
FilteringgetFilteredRowModel() + onColumnFiltersChangemanualFiltering: true for server-side
PaginationgetPaginationRowModel() + onPaginationChangemanualPagination: true + pageCount
Row selectionenableRowSelection + onRowSelectionChangeSet getRowId for stable selection keys
Column visibilityonColumnVisibilityChangeToggle with column.toggleVisibility()
Column pinningenableColumnPinning + initialState.columnPinningDon't pin group columns (known bug)
Row expandinggetExpandedRowModel() + getSubRowsFor nested/tree data
Column resizingenableColumnResizing + columnResizeModeonChange for live, onEnd for performant
Row groupinggetGroupedRowModel() + aggregationFnPerformance degrades at 10k+ rows
Server-sidemanual*: true flags + include state in queryKeyAll state in query key for proper refetching
Infinite scrolluseInfiniteQuery + flatten pagesCombine with TanStack Virtual for best perf
VirtualizationuseVirtualizer from @tanstack/react-virtualDisable when container hidden (tabs/modals)
React 19 Compiler'use no memo' directiveRequired until v9 fixes compiler compat

Common Operations

TaskMethod
Sort columncolumn.toggleSorting()
Filter columncolumn.setFilterValue(value)
First pagetable.firstPage()
Next pagetable.nextPage()
Previous pagetable.previousPage()
Last pagetable.lastPage()
Go to pagetable.setPageIndex(n)
Select rowrow.toggleSelected()
Hide columncolumn.toggleVisibility()
Get original datarow.original
Pin columncolumn.pin('left')
Resize columnheader.getResizeHandler()
Expand rowrow.toggleExpanded()

Row Models

ImportPurpose
getCoreRowModelRequired
getSortedRowModelSorting
getFilteredRowModelFiltering
getPaginationRowModelPagination
getExpandedRowModelExpanding
getGroupedRowModelGrouping
getFacetedRowModelFaceted filter counts
getFacetedUniqueValuesUnique values per facet
getFacetedMinMaxValuesMin/max per facet

Common Mistakes

MistakeCorrect Pattern
Unstable data/columns referenceMemoize with useMemo or define outside component
Missing manual* flags for server-sideSet manualPagination, manualSorting, manualFiltering
Query key missing table stateInclude pagination, sorting, filters in queryKey
Import from @tanstack/table-coreImport from @tanstack/react-table
Using v7 useTable / Header / accessorUse v8 useReactTable / header / accessorKey
Pinning group columnsPin individual columns within the group, not parent
Grouping on 10k+ rowsUse server-side grouping or disable for large datasets
Column filter not clearing on page changeReset pageIndex to 0 when filters change
Missing 'use no memo' with React CompilerAdd directive to components using useReactTable
Missing getRowId with row selectionSet getRowId: (row) => row.id for stable selection keys
Filter value type mismatchMatch value types; clear with undefined, not null

Delegation

  • Table pattern discovery: Use Explore agent
  • Server integration review: Use Task agent
  • Code review: Delegate to code-reviewer agent

If the tanstack-query skill is available, delegate data fetching, caching, and infinite query patterns to it. If the tanstack-virtual skill is available, delegate standalone virtualization patterns to it. If the tanstack-router skill is available, delegate URL search param sync for server-side table state to it. If the tanstack-start skill is available, delegate server functions for server-side data loading to it.

References

Comments

Markdown supported