core
它能做什么
这项技能解释 TanStack Table 的共享基础,即管理表格状态和行处理的库。适合在使用框架适配器之前需要理解核心模型的开发者。
适用场景
- ✓当你开始一个新表格,需要了解核心模型和稳定输入如何工作的时候。
- ✓当你在使用某项可选的表格功能之前,需要确认它是否可用的时候。
- ✓当你在编写不使用特定框架的集成代码的时候。
技能链接
https://github.com/TanStack/table/blob/main/packages/table-core/skills/core/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在我构建表格之前,你能解释 TanStack Table v9 如何处理数据和列吗?”
每周 5 个新技能,1 分钟读完。
工作原理
它解释该库负责协调状态和行处理,而你的代码控制标记,并给出一个构建表格并读取其行的最小示例。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
TanStack Table core
TanStack Table coordinates state and row processing. The renderer owns markup, styles, semantics, and interaction accessibility. Use the installed framework adapter in UI code; use constructTable for framework-neutral integrations.
Minimal setup
<!-- skill-snippet:check -->import {
constructTable,
createColumnHelper,
tableFeatures,
} from '@tanstack/table-core'
import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
type Person = { id: string; name: string }
const features = tableFeatures({
coreReactivityFeature: storeReactivityBindings(),
})
const helper = createColumnHelper<typeof features, Person>()
const columns = helper.columns([helper.accessor('name', { header: 'Name' })])
const data: Person[] = [{ id: '1', name: 'Ada' }]
const table = constructTable({
features,
columns,
data,
getRowId: (row) => row.id,
})
for (const row of table.getRowModel().rows) {
console.log(row.getAllCells().map((cell) => cell.getValue()))
}
Essential constraints
- The core row model is automatic. Optional APIs and state exist only after their feature is registered.
- Keep
features,data, andcolumnsstable between meaningful changes. Derive changing arrays with the adapter's memo/computed mechanism; an inline.map(),.filter(), column factory, or fresh[]fallback invalidates model work and can cause render loops. - Let
createColumnHelperandhelper.columns()preserve accessor value types. Derive feature types from the concrete registry when an explicit boundary is needed. - Call row, cell, column, and header methods on their instance. Use
row.getValue('name')or a callback that calls it; extractingconst { getValue } = rowloses itsthisreceiver. - Render the final
table.getRowModel().rows. The table object itself is not a DOM component.
Read for the current task
| Task | Read |
|---|---|
| Add or repair optional features, processing slots, or prerequisites | Feature architecture, then its relevant feature reference |
| Choose state ownership, initialize or reset state | Shared state |
Fix ColumnDef inference, reusable options, or scoped meta |
TypeScript inference |
| Diagnose a missing export, option, state slice, or instance method | API discovery |
| Implement row numbers, identity, or display-index behavior | Rows |
| Author behavior beyond built-ins or typed meta | Custom features |
| Migrate an existing v8 table | Migration audit |
For framework construction and rendering, load the installed package's getting-started skill with intent load <package>#getting-started, replacing <package> with the actual adapter package, such as @tanstack/react-table. For reactive reads or controlled wiring, load that package's table-state skill directly.
Installed API discovery
Start at node_modules/@tanstack/table-core/dist/index.d.ts and follow exported declarations. Adapter declaration layouts and missing-API diagnosis are in API discovery; read it when the expected export or declaration path is absent.
常见问题
为什么数据和列必须保持稳定?
这项技能说明,在每次渲染时更改它们会使模型工作失效,因此应使用适配器的 memo 或计算机制来派生变化的数组。
库会替我绘制表格吗?
不会,这项技能说明渲染器负责标记、样式和语义,而库负责管理状态和行。
所有表格功能默认都开启吗?
不是,可选的 API 和状态只有在其功能注册后才存在。
详情
作者的原始描述
Use TanStack Table v9 core architecture, stable data and columns, and inferred types. Route setup, missing APIs, row models, state, features, and framework-specific work.
repo: TanStack/table
热度
- GitHub 星标
- 29k
- 排名
- #9834
- 许可证
- MIT
- 更新时间
- 2026/10/21
评论
- …
同一仓库的更多技能
getting-started
29k教你的智能体如何在 Alpine.js 中使用 TanStack Table 构建并显示数据表格,涵盖设置、响应式数据和渲染行。
table-state
29k教你的智能体如何在 Alpine.js 中读取和控制表格状态,例如当前页码,使状态变化时屏幕能够更新。
devtools
29k教你的智能体如何把 Angular 表格注册到 TanStack Devtools 面板中,使开发者在构建应用时能检查每个表格。
getting-started
29k教你的智能体如何在 Angular 中创建并显示 TanStack 表格,涵盖 injectTable 设置、模板渲染和行数据的更新。