TanStack

TableOptions_Core

Interface: TableOptions_Core<TFeatures, TData>

Defined in: types/TableOptions.ts:33

Core options that are always available on a table, before optional feature options are mixed in.

Extends

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Properties

atoms?

ts
readonly optional atoms: Partial<{ [K in string | number | symbol]: Atom<ExtractFeatureMapTypes<TFeatures, TableState_FeatureMap>[K]> }>;

Defined in: core/table/coreTablesFeature.types.ts:109

Optionally, provide your own external writable atoms for individual state slices. When an atom is provided for a given slice, it takes precedence over options.state[key] and the internal base atom for that slice. Feature state update APIs write through the corresponding atom updater, so external atoms are the preferred v9 ownership model for app-managed table state slices.

Inherited from

TableOptions_Table.atoms


autoResetAll?

ts
readonly optional autoResetAll: boolean;

Defined in: core/table/coreTablesFeature.types.ts:113

Set this option to override any of the autoReset... feature options.

Inherited from

TableOptions_Table.autoResetAll


columns

ts
columns: readonly ColumnDef<TFeatures, TData, unknown>[];

Defined in: core/columns/coreColumnsFeature.types.ts:69

The array of column defs to use for the table.

Inherited from

TableOptions_Columns.columns


data

ts
readonly data: readonly TData[];

Defined in: core/table/coreTablesFeature.types.ts:117

The data for the table to display. When the data option changes reference, the table will reprocess the data.

Inherited from

TableOptions_Table.data


defaultColumn?

ts
optional defaultColumn: Partial<ColumnDef<TFeatures, TData, unknown>>;

Defined in: core/columns/coreColumnsFeature.types.ts:73

Default column options to use for all column defs supplied to the table.

Inherited from

TableOptions_Columns.defaultColumn


features

ts
readonly features: TFeatures & ValidateFeatureSlots<TFeatures>;

Defined in: core/table/coreTablesFeature.types.ts:101

The feature modules registered on this table instance.

Feature registration controls which state slices, options, and prototype APIs are available. This object also carries the table's row model factories (sortedRowModel, filteredRowModel, etc.), row model function registries (sortFns, filterFns, aggregationFns), and type-only meta slots (tableMeta, columnMeta).

Inherited from

TableOptions_Table.features


getRowId()?

ts
optional getRowId: (originalRow, index, parent?) => string;

Defined in: core/rows/coreRowsFeature.types.ts:115

This optional function is used to derive a unique ID for any given row. If not provided the row's index is used (nested rows join together with . using their grandparents' index e.g. index.index.index). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity e.g. a userId, taskId, database ID field, etc.

Parameters

originalRow

TData

index

number

parent?

Row<TFeatures, TData>

Returns

string

Example

ts
getRowId: row => row.userId

Inherited from

TableOptions_Rows.getRowId


getSubRows()?

ts
optional getSubRows: (originalRow, index) => readonly TData[] | undefined;

Defined in: core/rows/coreRowsFeature.types.ts:124

This optional function is used to access the sub rows for any given row. If you are using nested rows, you will need to use this function to return the sub rows object (or undefined) from the row.

Parameters

originalRow

TData

index

number

Returns

readonly TData[] | undefined

Example

ts
getSubRows: row => row.subRows

Inherited from

TableOptions_Rows.getSubRows


initialState?

ts
readonly optional initialState: Partial<ExtractFeatureMapTypes<TFeatures, TableState_FeatureMap>>;

Defined in: core/table/coreTablesFeature.types.ts:131

Optionally provide starting values for registered table state slices. Feature reset APIs use this value by default, and many reset APIs accept true to reset to that feature's blank/default state instead. Changing this object later does not reset table state, so it does not need to be stable.

Inherited from

TableOptions_Table.initialState


key?

ts
readonly optional key: string;

Defined in: core/table/coreTablesFeature.types.ts:124

Optional key used to identify this table instance.

This is used by TanStack Table Devtools to register and select tables. It is not required unless the table is passed to devtools.

Inherited from

TableOptions_Table.key


mergeOptions()?

ts
readonly optional mergeOptions: (defaultOptions, options) => TableOptions<TFeatures, TData>;

Defined in: core/table/coreTablesFeature.types.ts:135

This option is used to optionally implement the merging of table options.

Parameters

defaultOptions

TableOptions<TFeatures, TData>

options

Partial<TableOptions<TFeatures, TData>>

Returns

TableOptions<TFeatures, TData>

Inherited from

TableOptions_Table.mergeOptions


meta?

ts
readonly optional meta: ExtractTableMeta<TFeatures, TData>;

Defined in: core/table/coreTablesFeature.types.ts:145

You can pass any object to options.meta and access it anywhere the table is available via table.options.meta.

Declare its type per-table via the tableMeta type-only slot on the features option, or globally via declaration merging on TableMeta.

Inherited from

TableOptions_Table.meta


renderFallbackValue?

ts
optional renderFallbackValue: any;

Defined in: core/cells/coreCellsFeature.types.ts:67

Value used when the desired value is not found in the data.

Inherited from

TableOptions_Cell.renderFallbackValue


state?

ts
readonly optional state: Partial<ExtractFeatureMapTypes<TFeatures, TableState_FeatureMap>>;

Defined in: core/table/coreTablesFeature.types.ts:153

Optionally provide externally managed values for individual state slices.

Pair each slice with its matching on[State]Change callback so table state updates can be persisted outside the table. External atoms take precedence over this option when both are provided for the same slice.

Inherited from

TableOptions_Table.state