About custom-features
custom-features is a skill for implementing custom features in @tanstack/table-core. It guides developers through plugin types, lifecycle hooks, runtime APIs, and validation so declared behavior is registered and available on constructed tables.
Key features
- 01Choose plugins or metadata for behavior
- 02Declare matching FeatureMaps and runtime hooks
- 03Install table and object APIs by lifecycle
- 04Manage per-table mutable instance data
- 05Register stable features through tableFeatures
- 06Verify APIs, state, and reset behavior
Use cases
- 01Adding custom state or methods to tables
- 02Extending row, column, cell, or header behavior
- 03Diagnosing types that lack runtime implementations
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ tanstack/ table --skill custom-featuresAfter installing, type/custom-featuresin Claude Code to confirm it loaded.
Bundled filesreferences/plugin-example.md
Details
From the project READMEAuthor a custom feature
Read core and feature architecture first. Use a plugin for reusable state or behavior that must augment Table objects. Built-in options and typed tableMeta/columnMeta are usually enough for renderer callbacks and application configuration.
Implementation workflow
- Identify the state, options, and object methods the behavior owns. If it only passes callbacks or renderer data, read scoped meta typing and use meta instead.
- Before declaring plugin types or writing lifecycle hooks, read the complete plugin example. It enumerates all 10 public FeatureMaps, the API assignment helpers, lifecycle ordering, and the advanced row-model maps.
- Declare the feature key in
Plugins. Merge only FeatureMaps with matching runtime implementations; declarations alone install no behavior. - Preserve user state after defaults in
getInitialState; connect state updaters in default options. Install table methods withassignTableAPIsand object methods withassignPrototypeAPIsinside the corresponding lifecycle hooks. - Keep the feature object and
tableFeatures({ customFeature })result stable. Register the plugin throughtableFeaturesso inference and composition include it. - Verify the advertised state, options, methods, and resets on a constructed table. Each declared API must exist at runtime; reset behavior must respect the state owner.
Lifecycle boundaries
Use initTableInstanceData for mutable data owned by one table and resetTableInstanceData for clearing its transient contents. All feature initialization finishes before any constructTableAPIs hook. Keep method installation separate from data allocation.
Prototype methods are shared across the table's rows, columns, cells, or headers. Read per-object values through the method's current instance, and use the supported instance-data hooks for mutable fields. Read the example's installation rules before adding memoized methods or advanced row-model/cache wiring.
Common failures
- Types without matching runtime hooks advertise APIs that do not exist.
- Ad hoc mutation of constructed instances bypasses feature registration and inferred composition.
- Treating the density example as the only extension pattern misses column definitions and the other public FeatureMaps. Choose the maps required by the behavior; advanced row-model declarations also require runtime pipeline/cache wiring.
Installed API discovery
Inspect node_modules/@tanstack/table-core/dist/types/TableFeatures.d.ts, the exported *_FeatureMap interfaces in dist/types/, and assignTableAPIs/assignPrototypeAPIs in dist/utils.d.ts. Follow declarations under dist/features/ for comparable stock lifecycle signatures.