expanding

Configure row expansion for hierarchical subrows and custom detail panels in TanStack Table.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @tanstack/table-core.

What problem does it solve?

Row expansion state changes but no UI appears, or nested data fails to render because TanStack Table is headless and does not infer subrow structure or render detail panels automatically.

Core Features & Use Cases

  • Hierarchical Subrows: Register rowExpandingFeature with createExpandedRowModel and a getSubRows accessor to expand tree-structured data.
  • Custom Detail Panels: Use getRowCanExpand and row.getIsExpanded() to render your own detail rows or panels when a row is expanded.
  • Pagination Control: Configure paginateExpandedRows to decide whether expansion happens before or after pagination, and use manualExpanding for server-side expansion state.
  • Use Case: You have a nested org chart dataset and want users to click a row to reveal its children, with expanded rows staying grouped under their parents across pages.

Quick Start

Set up row expansion in my TanStack Table by adding rowExpandingFeature with a getSubRows accessor for my nested data and render a detail panel when a row is expanded.

Frequently Asked Questions about expanding

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

FAQPage Schema
How do I expand nested rows in TanStack Table?

Register rowExpandingFeature with createExpandedRowModel and provide a getSubRows accessor that returns each row's children. Nested object structure is not inferred automatically, so omitting getSubRows leaves subrows hidden.

How to render a custom detail panel when a row expands?

Set getRowCanExpand to return true, then check row.getIsExpanded() in your render logic and render your own detail row or panel. TanStack Table is headless, so toggling expansion state alone renders no markup.

Why does row expansion state change but no UI appears?

The table only tracks expansion state; it cannot render detail panels for you. You must conditionally render your detail UI when row.getIsExpanded() is true, and ensure getSubRows is defined for hierarchical data.

What does paginateExpandedRows do in TanStack Table?

It controls whether expansion happens before or after pagination. Setting it to false keeps descendant rows with their parent across pages; it does not make page size count only leaf rows.

Can I manage expansion state on the server with TanStack Table?

Yes, use manualExpanding to take control of expansion state and handle expanded row models yourself, which suits server-side data fetching scenarios where subrows load on demand.