tanstack-table

TanStack Table v8 headless data tables for React. Covers column definitions, sorting, filtering (fuzzy/faceted), server-side pagination with TanStack Query, infinite scroll, virtualization (TanStack Virtual), column/row pinning, row expanding/grouping, column resizing, and reusable Shadcn-styled components. Prevents 15 documented errors including infinite re-renders, React Compiler incompatibility, and server-side state mismatches. Use when building data tables, fixing table performance, implementing server-side pagination, adding filtering/sorting, or debugging table state issues.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tanstack-table" with this command: npx skills add oakoss/agent-skills/oakoss-agent-skills-tanstack-table

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

playwright

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

ui-ux-polish

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

tanstack-form

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

find-skills

No summary provided by upstream source.

Repository SourceNeeds Review