Column
TIP
This page refers to the table's column objects that are generated within the table instance. Refer to this link for the column definitions API.
The Column types are organized by feature. All feature types are ultimately joined in the single Column type definition.
API
CoreColumn
Basic column properties available on all columns regardless of features enabled. Includes column identification (id), hierarchy information (depth, parent), and references to associated rows and column definitions.
| Prop | Type |
|---|---|
The resolved accessor function to use when extracting the value for the column
from each row. Will only be defined if the column def has a valid accessor key
or function defined. | ( |
The original column def used to create the column. | ColumnDef< |
The child column (if the column is a group column). Will be an empty array if
the column is not a group column. | Column[] |
The depth of the column (if grouped) relative to the root column def array. | number |
Returns the flattened array of this column and all child/grand-child columns
for this column. | () => Column< |
Returns an array of all leaf-node columns for this column. If a column has no
children, it is considered the only leaf-node column. | () => Column< |
The resolved unique identifier for the column resolved in this priority: - A manual id property from the column def- The accessor key from the column def - The header string from the column def | string |
The parent column for this column. Will be undefined if this is a root column. | Column< |
(
item: TData,
) => string | string[]
ColumnDef<
TData,
TValue,
TColumnMeta
>
Column[]
number() => Column<
TData,
TValue,
ColumnMeta
>[]
() => Column<
TData,
TValue,
ColumnMeta
>[]
string- A manual
id property from the column def- The accessor key from the column def
- The header string from the column def
Column<
TData,
TValue
>
FiltersColumn
Properties and methods for filtering column data. Provides access to filter functions, filter values, and methods to apply or clear filters. See the Column Filtering guide for implementation details.
| Prop | Type |
|---|---|
Returns an automatically calculated filter function for the column based off of
the columns first known value. | () => FilterFn<TData> |
Returns whether the column can be column filtered. | () => boolean |
Returns whether the column can be globally filtered. Set to false
to disable a column from being scanned during global filtering. | () => boolean |
A function that computes and returns a min/max tuple derived from
getFacetedRowModel. Useful for displaying faceted result values. > ⚠️
Requires that you pass a valid getFacetedMinMaxValues function to
options.getFacetedMinMaxValues. A default implementation is provided via the
exported getFacetedMinMaxValues function. | () => [ |
Returns the row model with all other column filters applied, excluding its own
filter. Useful for displaying faceted result counts.️ Requires that you
pass a valid getFacetedRowModel function to options.facetedRowModel. A
default implementation is provided via the exported getFacetedRowModel
function. | () => RowModel<TData> |
A function that computes and returns a Map of unique values and their
occurrences derived from column.getFacetedRowModel. Useful for displaying
faceted result values. Requires that you pass a valid getFacetedUniqueValues function to options.getFacetedUniqueValues. A default
implementation is provided via the exported getFacetedUniqueValues
function. | () => Map< |
Returns the filter function (either user-defined or automatic, depending on
configuration) for the columnId specified. | () => FilterFn<TData> |
Returns the index of the column filter in the table's state.columnFilters
array. Returns -1 if not found. | () => number |
Returns the current filter value for the column. | () => unknown |
Returns whether the column is currently filtered. | () => boolean |
A function that sets the current filter value for the column. You can pass it a
value or an updater function for immutability-safe operations on existing
values. | ( |
() => FilterFn<TData>
() => boolean
column filtered.() => boolean
false
to disable a column from being scanned during global filtering.() => [
number,
number,
]
options.getFacetedMinMaxValues. A default implementation is provided via the
exported getFacetedMinMaxValues function.() => RowModel<TData>
options.facetedRowModel. A
default implementation is provided via the exported getFacetedRowModel
function.() => Map<
any,
number
>
Map of unique values and their
occurrences derived from column.getFacetedRowModel. Useful for displaying
faceted result values. Requires that you pass a valid getFacetedUniqueValues function to options.getFacetedUniqueValues. A default
implementation is provided via the exported getFacetedUniqueValues
function.() => FilterFn<TData>
() => number
state.columnFilters
array. Returns -1 if not found.() => unknown
() => boolean
(
updater: any,
) => void
SortingColumn
Properties and methods for controlling column sort behavior. Includes sort direction state, sort functions, and methods to toggle or clear sorting. See the Sorting guide for implementation details.
| Prop | Type |
|---|---|
Removes this column from the table's sorting state | () => void |
Returns a sort direction automatically inferred based on the columns values. | () => |
Returns a sorting function automatically inferred based on the columns values. | () => any |
Returns whether this column can be multi-sorted. | () => boolean |
Returns whether this column can be sorted. | () => boolean |
Returns the first direction that should be used when sorting this column. Useful for tooltips and aria-labels. | () => |
Returns the current sort direction of this column. | () => |
Returns the next sorting order. Useful for tooltips and aria-labels. | () => |
Returns the index position of this column's sorting within the sorting state | () => number |
Returns the resolved sorting function to be used for this column | () => any |
Returns a function that can be used to toggle this column's sorting state. This
is useful for attaching a click handler to the column header. | () => ( |
Toggles this columns sorting state. If desc is provided, it will force the
sort direction to that value. If isMulti is provided, it will additivity
multi-sort the column (or toggle it if it is already sorted). | ( |
() => void
() =>
| 'asc'
| 'desc'
() => any
() => boolean
() => boolean
() =>
| 'asc'
| 'desc'
Useful for tooltips and aria-labels.
() =>
| false
| 'asc'
| 'desc'
() =>
| false
| 'asc'
| 'desc'
() => number
() => any
() => (
event: unknown,
) => void
(
desc?: boolean,
isMulti?: boolean,
) => void
desc is provided, it will force the
sort direction to that value. If isMulti is provided, it will additivity
multi-sort the column (or toggle it if it is already sorted).GroupingColumn
Properties and methods for grouping rows by column values and aggregating grouped data. Provides access to aggregation functions, grouped row state, and methods to toggle grouping. See the Grouping guide for implementation details.
AggregationFn
The AggregationFn interface is used on several of the GroupingColumn properties.
export type AggregationFn<TData extends RowData> = (
columnId: string,
leafRows: Row<TData>[],
childRows: Row<TData>[],
) => any| Prop | Type |
|---|---|
Returns the aggregation function for the column. | () => AggregationFn<TData> |
Returns the automatically inferred aggregation function for the column. | () => AggregationFn<TData> |
Returns whether the column can be grouped. | () => boolean |
Returns the index of the column in the grouping state. | () => number |
Returns whether the column is currently grouped. | () => boolean |
Returns a function that toggles the grouping state of the column. This is
useful for passing to the onClick prop of a button. | () => () => void |
Toggles the grouping state of the column. | () => void |
() => AggregationFn<TData>
() => AggregationFn<TData>
() => boolean
() => number
() => boolean
() => () => void
onClick prop of a button.() => void
VisibilityColumn
Properties and methods for controlling column visibility state. Provides methods to show, hide, or toggle column visibility. See the Column Visibility guide for implementation details.
| Prop | Type |
|---|---|
Returns whether the column can be hidden. | () => boolean |
Returns whether the column is visible. | () => boolean |
Returns a function that can be used to toggle the column visibility. This
function can be used to bind to an event handler to an element. | () => ( |
Toggles the visibility of the column. | ( |
() => boolean
() => boolean
() => (
event: unknown,
) => void
(
value?: boolean,
) => void
ColumnPinningColumn
Properties and methods for pinning columns to the left or right side of the table. Includes pinning state and methods to pin or unpin columns. See the Column Pinning guide for implementation details.
| Prop | Type |
|---|---|
Returns whether the column can be pinned. | () => boolean |
Returns the pinned position of the column. ( 'left', 'right' or false) | () => |
Returns whether the column is pinned to the left. | () => boolean |
Returns whether the column is pinned to the right. | () => boolean |
Returns the numeric pinned index of the column within a pinned column group. | () => number |
Pins a column to the 'left' or 'right', or unpins the column to the center
if false is passed. | ( |
() => boolean
() =>
| false
| 'left'
| 'right'
'left', 'right' or false)() => boolean
() => boolean
() => number
(
position:
| false
| 'left'
| 'right',
) => void
'left' or 'right', or unpins the column to the center
if false is passed.ColumnSizingColumn
Properties and methods for managing column width and resizing behavior. Includes current size, min/max constraints, and methods to set or reset column dimensions. See the Column Sizing guide for implementation details.
| Prop | Type |
|---|---|
Returns true if the column can be resized. | () => boolean |
Returns true if the column is currently being resized. | () => boolean |
Returns the current size of the column. | () => number |
Returns the offset measurement along the row-axis (usually the x-axis for
standard tables) for the header. This is effectively a sum of the offset
measurements of all preceding headers. | ( |
Resets the column to its initial size. | () => void |
() => boolean
true if the column can be resized.() => boolean
true if the column is currently being resized.() => number
(
position?:
| false
| 'left'
| 'right',
) => number
() => void