table-features
它能做什么
这项技能解释如何开启表格功能,并在它们表现异常时进行修复。适合希望在用该库构建的表格中实现排序、筛选或分页的开发者。
适用场景
- ✓当你需要为 TanStack 表格添加排序、筛选、分页或选择功能的时候。
- ✓当排序等功能似乎没有任何作用,你需要检查其注册情况的时候。
- ✓当你需要知道某个行模型或排序函数依赖哪项功能的时候。
技能链接
https://github.com/TanStack/table/blob/main/packages/table-core/skills/table-features/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我为 TanStack 表格添加了排序功能,但点击表头没有任何反应。我该如何修复?”
每周 5 个新技能,1 分钟读完。
工作原理
它展示如何在功能列表中注册每项功能及其行模型,因为表格只会获得它注册过的行为,并解释每项功能的前提条件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Feature architecture
Read core first for the headless model and stable inputs.
Register the behavior the table uses
<!-- skill-snippet:check -->import {
createSortedRowModel,
rowSortingFeature,
sortFn_alphanumeric,
tableFeatures,
} from '@tanstack/table-core'
export const features = tableFeatures({
rowSortingFeature,
sortedRowModel: createSortedRowModel(),
sortFns: { alphanumeric: sortFn_alphanumeric },
})
Pass the stable features object to the installed adapter constructor. The concrete registry determines optional APIs, options, state slices, and their types. The core row model is automatic; a custom core model uses coreRowModel.
Registration rules
- Register each prerequisite feature before its dependent slot in the same
tableFeaturescall. A processing factory alone cannot install that feature's APIs or state. - Row-model factories use
create*RowModel()feature slots. Their names and prerequisites are in the feature reference. They take no function-registry arguments. filterFns,sortFns, andaggregationFnsare feature slots, not table options. They requirecolumnFilteringFeature,rowSortingFeature, androwAggregationFeature, respectively.- Import individual built-ins such as
sortFn_alphanumericand register their conventional keys. Those keys become typed string names;'auto'can resolve only registered functions. Pass a function directly when a column needs no named registry entry. Full registry exports bundle every built-in. columnResizingFeaturerequirescolumnSizingFeature;globalFilteringFeaturerequirescolumnFilteringFeature. Check installedFeatureSlotPrereqsfor other dependencies.- Use explicit features for normal construction.
stockFeaturesis a deliberate all-features convenience or temporary migration aid, with the corresponding bundle cost.
A missing API can mean missing registration. Check the concrete feature object before casting, recreating an API, or assuming v9 removed it.
Select references by the requested change
Read only references needed for the requested behavior and its dependencies, including features being added. An unrelated feature already registered on the table does not make its reference necessary.
| Task involves | Read |
|---|---|
| Manual modes, server data, mixed row-processing stages, or dataset scope | Client/server ownership |
| Totals, multiple aggregations, grouped aggregate values, or custom aggregate definitions | Aggregation |
| Facet option counts, numeric ranges, or incomplete server facets | Column faceting |
| Per-column filters, filter functions, metadata, or nested-row filtering | Column filtering |
| Group rows, placeholders, or grouping with expansion/pagination | Grouping |
| Drag ordering or leaf-column order differing from state | Column ordering |
| Sticky column regions, logical start/end, or pinning gaps | Column pinning |
| Drag resize handles, gesture events, or resize performance | Column resizing |
| Numeric widths, min/max limits, or model/CSS size mismatch | Column sizing |
| Hidden columns, visibility-aware rendering, or hiding controls | Column visibility |
| A search across columns or global-filter eligibility | Global filtering |
| Hierarchical subrows, detail panels, or expansion/page interaction | Expanding |
| Page slicing, counts, navigation, or page-index resets |
常见问题
即使我写了功能代码,为什么它仍然不工作?
这项技能说明,功能必须注册到表格的功能列表中,而有些功能需要先注册另一项功能。
排序和筛选函数放在哪里?
这项技能说明它们是功能列表中的功能插槽,而不是普通的表格选项。
我需要阅读每一份功能参考资料吗?
不需要,这项技能建议只阅读与任务相符的参考资料。
详情
作者的原始描述
'Add or debug Table v9 features: registration, row-model slots, prerequisites, sorting, filtering, pagination, selection, spanning, and column layout. Read only task-relevant feature references.'
repo: TanStack/table
热度
- GitHub 星标
- 29k
- 排名
- #9837
- 许可证
- 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 设置、模板渲染和行数据的更新。