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.
AccessorKeyColumnDef<
TData extends unknown,
TValue = unknown,
TColumnMeta = ColumnMeta,
>
| string
| keyof TData
| string
| ((
props: CellContext<
TData,
TValue
>,
) => any)
AggregationFnOption<TData>
| string
| ((
props: CellContext<
TData,
TValue,
TColumnMeta
>,
) => any)
booleancolumn filter for this column.booleanbooleanbooleanbooleanbooleantrue.booleanbooleanFilterFnOption<TData>
stringheader when it is a
string, then to the column id.| string
| ((
props: HeaderContext<
TData,
TValue,
TColumnMeta
>,
) => any)
(
value: unknown,
) => string
String(value) for primitive values, otherwise an empty string.(
row: TData,
) => any
accessorKey / accessorFn will be used
instead.(
originalRow: TData,
index: number,
) => unknown[]
| string
| ((props: {
column: Column<
TData,
TValue
>
header: Header<
TData,
TValue
>
table: TableInstance<TData>
}) => any)
stringbooleannumberTColumnMetanumbernumberbooleantrue for sorting toggles on this column to start in the descending
direction.| 'text'
| 'auto'
| 'alphanumeric'
| 'alphanumericCaseSensitive'
| 'basic'
| 'datetime'
| 'textCaseSensitive'
| SortingFn<TData>
- A
string referencing a built-in sorting function- A custom sorting function
-1 | 1 | false
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.
SortingColumnDef<TData extends unknown>
booleanbooleanbooleanbooleantrue for sorting toggles on this column to start in the descending
direction.| 'text'
| 'auto'
| 'alphanumeric'
| 'alphanumericCaseSensitive'
| 'basic'
| 'datetime'
| 'textCaseSensitive'
| SortingFn<TData>
- A
string referencing a built-in sorting function- A custom sorting function
-1 | 1 | false
FiltersColumnDef
Configures filtering behavior for columns. Properties control whether filtering is enabled, the filter function to use, and filter metadata. See Column Filtering.
FiltersColumnDef<TData extends unknown>
booleancolumn filter for this column.booleanFilterFnOption<TData>
stringheader when it is a
string, then to the column id.(
value: unknown,
) => string
String(value) for primitive values, otherwise an empty string.ColumnSizingColumnDef
Configures column sizing behavior. Properties control minimum and maximum widths, default size, and whether the column can be resized. See Column Sizing.
booleannumbernumbernumberGroupingColumnDef
Configures grouping behavior for columns. Properties control whether the column can be grouped, aggregation functions, and how grouped cells display. See Column Grouping.
GroupingColumnDef<TData extends unknown, TValue>
| string
| ((
props: CellContext<
TData,
TValue
>,
) => 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.
boolean