react/getting-started

Build a minimal TanStack Table v9 React datagrid with type-safe columns.

28.3k|3.6k|Updated Oct 20, 2016
One-click install
npx skills add https://github.com/TanStack/table --skill react-getting-started
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react/getting-started
Source: https://github.com/TanStack/table/tree/main/packages/react-table/skills/react/getting-started
Command: npx skills add https://github.com/TanStack/table --skill react-getting-started

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the confusion beginners face when setting up a working, type-safe TanStack Table v9 in React, especially around the required v9 registry concepts like _features and _rowModels.

Core Features & Use Cases

  • Minimum-viable v9 setup: Create a table with the mandatory _features and _rowModels (even when empty), define columns, and render headers and rows with FlexRender.
  • Add sorting correctly: Register rowSortingFeature in _features, provide createSortedRowModel with sortFns in _rowModels, and wire UI to getToggleSortingHandler plus getIsSorted.
  • Layer features incrementally: Add pagination and filtering by registering their features and row-model factories, while using the built-in table APIs instead of re-implementing behavior.

Quick Start

Ask the AI to generate a minimal TanStack Table v9 React example that defines _features via tableFeatures({}), sets _rowModels to {}, uses createColumnHelper with <typeof _features, TData>, instantiates useTable, and renders headers and rows with <table.FlexRender>.

Frequently Asked Questions about react/getting-started

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a type-safe React datagrid using TanStack Table v9?

To set up a type-safe React datagrid, use createColumnHelper<typeof _features, TData> for column definitions, register mandatory _features via tableFeatures(), set _rowModels (even as empty {}), and render cells with FlexRender.

Why does my TanStack Table v9 React integration fail without _features and _rowModels?

TanStack Table v9 React integration fails without _features and _rowModels because v9 requires mandatory registration of both via tableFeatures() and _rowModels (even when empty) to initialize the table instance correctly.

How do I add sorting to a TanStack Table v9 component in React?

To add sorting to a TanStack Table v9 component, register rowSortingFeature in _features, provide createSortedRowModel with sortFns in _rowModels, and wire the UI using getToggleSortingHandler and getIsSorted.

Can I add pagination and filtering incrementally to a React TanStack Table?

Yes, you can add pagination and filtering incrementally to a React TanStack Table by registering their specific features and row-model factories, utilizing the built-in table APIs instead of re-implementing the behavior from scratch.

What is the correct way to define columns for TanStack Table v9 in React 18+?

The correct way to define columns for TanStack Table v9 in React 18+ is using createColumnHelper<typeof _features, TData>, ensuring strict type safety across your column definitions and matching the registered table features.

Does TanStack Table v9 require FlexRender for rendering headers and rows in React?

Yes, TanStack Table v9 requires FlexRender for rendering headers and rows in React, acting as the primary bridge to dynamically render cell content based on your defined column structure and table state.