Represent a concrete column for a specific row model
Typing table internals
TanStack · Type Alias
Column is TanStack Table's feature-aware column type. It combines the core column contract with members derived from enabled features and is parameterized by features, row data, and cell-value type.
Column combines the core column shape with the feature-specific types selected by TFeatures. TData identifies the row model, while TValue describes the value produced by the column and defaults to unknown when omitted.
type Column<TFeatures, TData, TValue> = Column_Core<TFeatures, TData, TValue> & ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>>;| Name | Type | Description |
|---|---|---|
TFeatures | TFeatures extends TableFeatures | Enabled table features used to derive feature-specific column types; must extend TableFeatures. |
TData | TData extends RowData | The table's row-data type; must extend RowData. |
TValue | TValue = unknown | The value type represented by the column; defaults to unknown. |
A type combining Column_Core<TFeatures, TData, TValue> with the feature-specific types extracted from Column_FeatureMap<TFeatures, TData>.
import type { Column, RowData, TableFeatures } from '@tanstack/table-core'
type User = { name: string; age: number }
type Features = TableFeatures
type UserNameColumn = Column<Features, User, string>This declares a column type for User rows whose cell values are strings.
Typing table internals
Type-safe cell values
Feature-aware APIs
Column is a generic type alias that combines Column_Core with the feature-derived types from ExtractFeatureMapTypes. Its three parameters describe enabled features, row data, and column values.
Follow-up: How would you preserve value safety for a numeric column? Use Column<Features, Row, number> rather than relying on the unknown default.
TFeatures must extend TableFeatures, and TData must extend RowData. TValue is optional and defaults to unknown.
Follow-up: Why constrain TData to RowData? The alias follows the table library's row-data contract instead of accepting an unconstrained type.
The alias is defined as Column_Core<TFeatures, TData, TValue> intersected with ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>>. This adds feature-specific column members to the core column contract.
Follow-up: What changes when features differ? The extracted feature map changes the additional members available on the resulting column type.
Column_CoreColumn_FeatureMapColumnDefRowDataTableFeatures