Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

TanStack · Type Alias

Cell

Cell is TanStack Table's feature-aware type for a table cell. It combines the core cell contract with cell-related types supplied by the enabled table features.

How it works

Cell is a feature-aware table-cell type. It combines the core cell contract with the type contributions supplied by the selected table features, while generics describe the feature set, row data, and cell value.

Syntax

type Cell<TFeatures, TData, TValue> = Cell_Core<TFeatures, TData, TValue> & ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap>

Parameters

NameTypeDescription
TFeaturesTableFeaturesThe table features enabled for the cell type.
TDataRowDataThe row-data type associated with the cell.
TValueCellDataThe value type held by the cell; defaults to CellData.

Returns

A Cell type combining Cell_Core<TFeatures, TData, TValue> with feature-specific cell types.

Key points

  • Cell is an intersection of the core cell type and the types contributed by enabled features.
  • The feature generic must be a valid TableFeatures collection.
  • The row-data generic is restricted to TanStack Table's RowData type.
  • The cell-value generic is constrained to CellData and defaults to CellData.
  • The alias is defined in the table package's types/Cell.ts source file.

Common mistakes

  • If the value type is omitted, TValue defaults to the general CellData type, so provide it when precise cell-value typing matters.

Example: Typing a table cell

import type { Cell, TableFeatures, RowData, CellData } from '@tanstack/table-core'

type Person = { name: string }
type Features = TableFeatures

declare const cell: Cell<Features, Person, string>

const value: string = cell.getValue()
console.log(value)

This type annotation describes a cell containing a string value for a Person row.

When to use it

Annotate cell values

Strongly typing a cell instance in TypeScript

Model enabled features

Preserving feature-specific cell members

Associate row data

Connecting a cell to its row's domain object

Interview questions

QWhat does the Cell type alias represent?

Cell is generic over the enabled table features, the row-data type, and the cell-value type. Its definition combines Cell_Core with the feature-specific cell types extracted from the feature map.

Follow-up: Why is TFeatures constrained? It must extend TableFeatures so feature-specific additions can be derived safely from the table's supported feature set.

QWhat do the TData and TValue generics control?

TData extends RowData and identifies the row shape associated with the cell. TValue extends CellData and represents the value held by that cell.

Follow-up: What happens when TValue is omitted? It defaults to CellData, which is broader than a domain-specific value type.

QHow does Cell incorporate table features?

The alias is feature-aware rather than only a fixed core type: it intersects Cell_Core<TFeatures, TData, TValue> with ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap>. This allows enabled features to augment the cell type.

Follow-up: How would you preserve those augmentations in application code? Use the same TFeatures type when declaring or passing cells instead of reducing the value to an unrelated base type.

  • Cell_Core
  • CellContext
  • CellData
  • constructCell
  • TableFeatures
  • RowData

Source: Cell. Checked 2026-10-16.