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
Name & Description | Option(s) | Default |
---|---|---|
The original column def used to create the column. |
| |
The child column (if the column is a group column). Will be an empty array if
the column is not a group column. |
| |
The depth of the column (if grouped) relative to the root column def array. |
| |
Returns the flattened array of this column and all child/grand-child columns
for this 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. |
| |
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 |
| |
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 parent column for this column. Will be undefined if this is a root column. |
|
Type
ColumnDef
Description
The original column def used to create the column.
Type
Column[]
Description
The child column (if the column is a group column). Will be an empty array if
the column is not a group column.
Type
number
Description
The depth of the column (if grouped) relative to the root column def array.
Type
() => Column<TData,TValue,ColumnMeta>[]
Description
Returns the flattened array of this column and all child/grand-child columns
for this column.
Type
() => Column<TData,TValue,ColumnMeta>[]
Description
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.
Type
string
Description
The resolved unique identifier for the column resolved in this priority:
- A manual
- The accessor key from the column def
- The header string from the column def
- A manual
id
property from the column def- The accessor key from the column def
- The header string from the column def
Type
(originalRow: TData,index: number,) => TValue
Description
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.
Type
Column
Description
The parent column for this column. Will be undefined if this is a root column.
FiltersColumn
Name & Description | Option(s) | Default |
---|---|---|
Returns an automatically calculated filter function for the column based off of
the columns first known value. |
| |
Returns whether the column can be **column** filtered. |
| |
Returns whether the column can be globally filtered. Set to false
to disable a column from being scanned during global filtering. |
| |
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. |
| |
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. |
| |
Returns the filter function (either user-defined or automatic, depending on
configuration) for the columnId specified. |
| |
Returns the index of the column filter in the table's state.columnFilters
array. Returns -1 if not found. |
| |
Returns the current filter value for the column. |
| |
Returns whether the column is currently filtered. |
| |
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. |
|
Type
() => signature
Description
Returns an automatically calculated filter function for the column based off of
the columns first known value.
Type
() => boolean
Description
Returns whether the column can be **column** filtered.
Type
() => boolean
Description
Returns whether the column can be globally filtered. Set to
false
to disable a column from being scanned during global filtering.Type
() => [number,number,]
Description
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.Type
() => RowModel<TData>
Description
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.Type
() => Map<any,number>
Description
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.Type
() => signature
Description
Returns the filter function (either user-defined or automatic, depending on
configuration) for the columnId specified.
Type
() => number
Description
Returns the index of the column filter in the table's
state.columnFilters
array. Returns -1
if not found.Type
() => unknown
Description
Returns the current filter value for the column.
Type
() => boolean
Description
Returns whether the column is currently filtered.
Type
(updater: any,) => void
Description
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.
SortingColumn
Name & Description | Option(s) | Default |
---|---|---|
Removes this column from the table's sorting state |
| |
Returns a sort direction automatically inferred based on the columns values. |
| |
Returns a sorting function automatically inferred based on the columns values. |
| |
Returns whether this column can be multi-sorted. |
| |
Returns whether this column can be sorted. |
| |
Returns the first direction that should be used when sorting this column. |
| |
Returns the current sort direction of this column. |
| |
Returns the next sorting order. |
| |
Returns the index position of this column's sorting within the sorting state |
| |
Returns the resolved sorting function to be used for this column |
| |
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). |
|
Type
() => void
Description
Removes this column from the table's sorting state
Type
() =>| 'asc'| 'desc'
Description
Returns a sort direction automatically inferred based on the columns values.
Type
() => any
Description
Returns a sorting function automatically inferred based on the columns values.
Type
() => boolean
Description
Returns whether this column can be multi-sorted.
Type
() => boolean
Description
Returns whether this column can be sorted.
Type
() =>| 'asc'| 'desc'
Description
Returns the first direction that should be used when sorting this column.
Type
() =>| false| 'asc'| 'desc'
Description
Returns the current sort direction of this column.
Type
() =>| false| 'asc'| 'desc'
Description
Returns the next sorting order.
Type
() => number
Description
Returns the index position of this column's sorting within the sorting state
Type
() => any
Description
Returns the resolved sorting function to be used for this column
Type
() => (event: unknown,) => void
Description
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.
Type
(desc?: boolean,isMulti?: boolean,) => void
Description
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).GroupingColumn
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
Name & Description | Option(s) | Default |
---|---|---|
Returns the aggregation function for the column. |
| |
Returns the automatically inferred aggregation function for the column. |
| |
Returns whether the column can be grouped. |
| |
Returns the index of the column in the grouping state. |
| |
Returns whether the column is currently grouped. |
| |
Returns a function that toggles the grouping state of the column. This is
useful for passing to the onClick prop of a button. |
| |
Toggles the grouping state of the column. |
|
Type
() => AggregationFn<TData>
Description
Returns the aggregation function for the column.
Type
() => AggregationFn<TData>
Description
Returns the automatically inferred aggregation function for the column.
Type
() => boolean
Description
Returns whether the column can be grouped.
Type
() => number
Description
Returns the index of the column in the grouping state.
Type
() => boolean
Description
Returns whether the column is currently grouped.
Type
() => () => void
Description
Returns a function that toggles the grouping state of the column. This is
useful for passing to the
onClick
prop of a button.Type
() => void
Description
Toggles the grouping state of the column.
VisibilityColumn
Name & Description | Option(s) | Default |
---|---|---|
Returns whether the column can be hidden. |
| |
Returns whether the column is visible. |
| |
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. |
|
Type
() => boolean
Description
Returns whether the column can be hidden.
Type
() => boolean
Description
Returns whether the column is visible.
Type
() => (event: unknown,) => void
Description
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.
Type
(value?: boolean,) => void
Description
Toggles the visibility of the column.
ColumnPinningColumn
Name & Description | Option(s) | Default |
---|---|---|
Returns whether the column can be pinned. |
| |
Returns the pinned position of the column. ( 'left' , 'right' or false ) |
| |
Returns whether the column is pinned to the left. |
| |
Returns whether the column is pinned to the right. |
| |
Returns the numeric pinned index of the column within a pinned column group. |
| |
Pins a column to the 'left' or 'right' , or unpins the column to the center
if false is passed. |
|
Type
() => boolean
Description
Returns whether the column can be pinned.
Type
() =>| false| 'left'| 'right'
Description
Returns the pinned position of the column. (
'left'
, 'right'
or false
)Type
() => boolean
Description
Returns whether the column is pinned to the left.
Type
() => boolean
Description
Returns whether the column is pinned to the right.
Type
() => number
Description
Returns the numeric pinned index of the column within a pinned column group.
Type
(position:| false| 'left'| 'right',) => void
Description
Pins a column to the
'left'
or 'right'
, or unpins the column to the center
if false
is passed.ColumnSizingColumn
Name & Description | Option(s) | Default |
---|---|---|
Returns true if the column can be resized. |
| |
Returns true if the column is currently being resized. |
| |
Returns the current size of the column. |
| |
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. |
|
Type
() => boolean
Description
Returns
true
if the column can be resized.Type
() => boolean
Description
Returns
true
if the column is currently being resized.Type
() => number
Description
Returns the current size of the column.
Type
(position?:| false| 'left'| 'right',) => number
Description
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.
Type
() => void
Description
Resets the column to its initial size.