Column Definitions
This page documents the types for column definition objects. Each column definition type provides properties for specific table features. For a comprehensive guide on creating and configuring columns, see Column Definitions.
API
AccessorColumnDef
Defines columns that access data from your table's data source. This is the primary column definition type used to configure how data is extracted and displayed.
| Prop | Type |
|---|---|
Key | | string |
The cell to display each row for the column if the cell is an aggregate. | | string |
The resolved aggregation function for the column. | AggregationFnOption<TData> |
| string | |
Enables/disables the column filter for this column. | boolean |
Enables/disables the global filter for this column. | boolean |
Enables/disables grouping for this column. | boolean |
Enables/Disables hiding the column. | boolean |
Enables/Disables multi-sorting for this column. | boolean |
Enables/disables column pinning for this column. Defaults to true. | boolean |
Enables or disables column resizing for the column. | boolean |
Enables/Disables sorting for this column. | boolean |
The filter function to use with this column. Can be the name of a built-in
filter function or a custom filter function. | FilterFnOption<TData> |
| string | |
Specify a value to be used for grouping rows on this column. If this option is
not specified, the value derived from accessorKey / accessorFn will be used
instead. | ( |
( | |
Header definition. | | string |
ID of the column | string |
Inverts the order of the sorting for this column. This is useful for values
that have an inverted best/worst scale where lower numbers are better, e.g.,a
ranking (1st, 2nd, 3rd) or golf-like scoring | boolean |
The maximum allowed size for the column | number |
Column Meta | any |
The minimum allowed size for the column | number |
The desired size for the column | number |
Set to true for sorting toggles on this column to start in the descending
direction. | boolean |
The sorting function to use with this column. - A string referencing a built-in sorting function- A custom sorting function | | 'auto' |
Configure how undefined values are sorted for this column. | false | 1 | -1 |
| string
| keyof TData
| string
| ((props: {
cell: Cell<
TData,
TValue,
TColumnMeta
>
column: Column<
TData,
TValue,
TColumnMeta
>
getValue: () => TValue
row: Row<TData>
table: TableInstance<TData>
}) => any)
AggregationFnOption<TData>
| string
| ((props: {
cell: Cell<
TData,
TValue,
TColumnMeta
>
column: Column<
TData,
TValue,
TColumnMeta
>
getValue: () => TValue
row: Row<TData>
table: TableInstance<TData>
}) => any)
booleancolumn filter for this column.booleanbooleanbooleanbooleanbooleantrue.booleanbooleanFilterFnOption<TData>
| string
| ((props: {
column: Column<
TData,
TValue,
TColumnMeta
>
header: Header<
TData,
TValue,
TColumnMeta
>
table: TableInstance<TData>
}) => any)
(
row: TData,
) => any
accessorKey / accessorFn will be used
instead.(
item: TData,
) => string | string[]
| string
| ((props: {
column: Column<
TData,
TValue,
TColumnMeta
>
header: Header<
TData,
TValue,
TColumnMeta
>
table: TableInstance<TData>
}) => any)
stringbooleannumberanynumbernumberbooleantrue for sorting toggles on this column to start in the descending
direction.| 'auto'
| 'alphanumeric'
| 'alphanumericCaseSensitive'
| 'basic'
| 'datetime'
| 'text'
| 'textCaseSensitive'
| any
- A
string referencing a built-in sorting function- A custom sorting function
false | 1 | -1
Feature-Specific Properties
The following column definition types extend the base column definition with feature-specific properties.
SortingColumnDef
Configures sorting behavior for columns. Properties control whether sorting is enabled, the default sort direction, and custom sorting functions. See Sorting.
| Prop | Type |
|---|---|
Enables/Disables multi-sorting for this column. | boolean |
Enables/Disables sorting for this column. | boolean |
Inverts the order of the sorting for this column. This is useful for values
that have an inverted best/worst scale where lower numbers are better, e.g.,a
ranking (1st, 2nd, 3rd) or golf-like scoring | boolean |
Set to true for sorting toggles on this column to start in the descending
direction. | boolean |
The sorting function to use with this column. - A string referencing a built-in sorting function- A custom sorting function | | 'auto' |
Configure how undefined values are sorted for this column. | false | 1 | -1 |
booleanbooleanbooleanbooleantrue for sorting toggles on this column to start in the descending
direction.| 'auto'
| 'alphanumeric'
| 'alphanumericCaseSensitive'
| 'basic'
| 'datetime'
| 'text'
| 'textCaseSensitive'
| any
- A
string referencing a built-in sorting function- A custom sorting function
false | 1 | -1
FiltersColumnDef
Configures filtering behavior for columns. Properties control whether filtering is enabled, the filter function to use, and filter metadata. See Column Filtering.
| Prop | Type |
|---|---|
Enables/disables the column filter for this column. | boolean |
Enables/disables the global filter for this column. | boolean |
The filter function to use with this column. Can be the name of a built-in
filter function or a custom filter function. | FilterFnOption<TData> |
booleancolumn filter for this column.booleanFilterFnOption<TData>
ColumnSizingColumnDef
Configures column sizing behavior. Properties control minimum and maximum widths, default size, and whether the column can be resized. See Column Sizing.
| Prop | Type |
|---|---|
Enables or disables column resizing for the column. | boolean |
The maximum allowed size for the column | number |
The minimum allowed size for the column | number |
The desired size for the column | number |
booleannumbernumbernumberGroupingColumnDef
Configures grouping behavior for columns. Properties control whether the column can be grouped, aggregation functions, and how grouped cells display. See Column Grouping.
| Prop | Type |
|---|---|
The cell to display each row for the column if the cell is an aggregate. | | string |
The resolved aggregation function for the column. | AggregationFnOption<TData> |
Enables/disables grouping for this column. | boolean |
Specify a value to be used for grouping rows on this column. If this option is
not specified, the value derived from accessorKey / accessorFn will be used
instead. | ( |
| string
| ((props: {
cell: Cell<
TData,
TValue,
TColumnMeta
>
column: Column<
TData,
TValue,
TColumnMeta
>
getValue: () => TValue
row: Row<TData>
table: TableInstance<TData>
}) => any)
AggregationFnOption<TData>
boolean(
row: TData,
) => any
accessorKey / accessorFn will be used
instead.VisibilityColumnDef
Configures column visibility behavior. Properties control whether columns can be hidden by users and whether they are visible by default. See Column Visibility.
| Prop | Type |
|---|---|
Enables/Disables hiding the column. | boolean |
boolean