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.

PropType
| string
| keyof TData
The cell to display each row for the column if the cell is an aggregate.
| string
| ((
props: CellContext<
TData,
TValue
>,
) => any)
The resolved aggregation function for the column.
AggregationFnOption<TData>
| string
| ((
props: CellContext<
TData,
TValue,
TColumnMeta
>,
) => any)
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
| ((
props: HeaderContext<
TData,
TValue,
TColumnMeta
>,
) => any)
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.
    (
    row: TData,
    ) => any
    (
    originalRow: TData,
    index: number,
    ) => unknown[]
    Header definition.
    | string
    | ((props: {
    column: Column<
    TData,
    TValue
    >
    header: Header<
    TData,
    TValue
    >
    table: TableInstance<TData>
    }) => any)
    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
    TColumnMeta
    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
    | 'text'
    | 'auto'
    | 'alphanumeric'
    | 'alphanumericCaseSensitive'
    | 'basic'
    | 'datetime'
    | 'textCaseSensitive'
    | SortingFn<TData>
    Configure how undefined values are sorted for this column.
    • false: Undefined values will be considered tied and need to be sorted by the next column filter or original index (whichever applies).
    • -1: Undefined values will be sorted with higher priority (ascending) (if ascending, undefined will appear on the beginning of the list)
    • 1: Undefined values will be sorted with lower priority (descending) (if ascending, undefined will appear on the end of the list)
    -1 | 1 | false
    Type
    | string
    | keyof TData
    Description
    Key
    Type
    | string
    | ((
    props: CellContext<
    TData,
    TValue
    >,
    ) => any)
    Description
    The cell to display each row for the column if the cell is an aggregate.
    Type
    AggregationFnOption<TData>
    Description
    The resolved aggregation function for the column.
    Type
    | string
    | ((
    props: CellContext<
    TData,
    TValue,
    TColumnMeta
    >,
    ) => any)
    Type
    boolean
    Description
    Enables/disables the column filter for this column.
    Type
    boolean
    Description
    Enables/disables the global filter for this column.
    Type
    boolean
    Description
    Enables/disables grouping for this column.
    Type
    boolean
    Description
    Enables/Disables hiding the column.
    Type
    boolean
    Description
    Enables/Disables multi-sorting for this column.
    Type
    boolean
    Description
    Enables/disables column pinning for this column. Defaults to true.
    Type
    boolean
    Description
    Enables or disables column resizing for the column.
    Type
    boolean
    Description
    Enables/Disables sorting for this column.
    Type
    FilterFnOption<TData>
    Description
    The filter function to use with this column. Can be the name of a built-in filter function or a custom filter function.
    Type
    | string
    | ((
    props: HeaderContext<
    TData,
    TValue,
    TColumnMeta
    >,
    ) => any)
    Type
    (
    row: TData,
    ) => any
    Description
    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.
      Type
      (
      originalRow: TData,
      index: number,
      ) => unknown[]
      Type
      | string
      | ((props: {
      column: Column<
      TData,
      TValue
      >
      header: Header<
      TData,
      TValue
      >
      table: TableInstance<TData>
      }) => any)
      Description
      Header definition.
      Type
      string
      Description
      ID of the column
      Type
      boolean
      Description
      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
      Type
      number
      Description
      The maximum allowed size for the column
      Type
      TColumnMeta
      Description
      Column Meta
      Type
      number
      Description
      The minimum allowed size for the column
      Type
      number
      Description
      The desired size for the column
      Type
      boolean
      Description
      Set to true for sorting toggles on this column to start in the descending direction.
      Type
      | 'text'
      | 'auto'
      | 'alphanumeric'
      | 'alphanumericCaseSensitive'
      | 'basic'
      | 'datetime'
      | 'textCaseSensitive'
      | SortingFn<TData>
      Description
      The sorting function to use with this column.
      - A
      string referencing a built-in sorting function
      - A custom sorting function
      Type
      -1 | 1 | false
      Description
      Configure how undefined values are sorted for this column.
      • false: Undefined values will be considered tied and need to be sorted by the next column filter or original index (whichever applies).
      • -1: Undefined values will be sorted with higher priority (ascending) (if ascending, undefined will appear on the beginning of the list)
      • 1: Undefined values will be sorted with lower priority (descending) (if ascending, undefined will appear on the end of the list)

      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.

      PropType
      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
      | 'text'
      | 'auto'
      | 'alphanumeric'
      | 'alphanumericCaseSensitive'
      | 'basic'
      | 'datetime'
      | 'textCaseSensitive'
      | SortingFn<TData>
      Configure how undefined values are sorted for this column.
      • false: Undefined values will be considered tied and need to be sorted by the next column filter or original index (whichever applies).
      • -1: Undefined values will be sorted with higher priority (ascending) (if ascending, undefined will appear on the beginning of the list)
      • 1: Undefined values will be sorted with lower priority (descending) (if ascending, undefined will appear on the end of the list)
      -1 | 1 | false
      Type
      boolean
      Description
      Enables/Disables multi-sorting for this column.
      Type
      boolean
      Description
      Enables/Disables sorting for this column.
      Type
      boolean
      Description
      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
      Type
      boolean
      Description
      Set to true for sorting toggles on this column to start in the descending direction.
      Type
      | 'text'
      | 'auto'
      | 'alphanumeric'
      | 'alphanumericCaseSensitive'
      | 'basic'
      | 'datetime'
      | 'textCaseSensitive'
      | SortingFn<TData>
      Description
      The sorting function to use with this column.
      - A
      string referencing a built-in sorting function
      - A custom sorting function
      Type
      -1 | 1 | false
      Description
      Configure how undefined values are sorted for this column.
      • false: Undefined values will be considered tied and need to be sorted by the next column filter or original index (whichever applies).
      • -1: Undefined values will be sorted with higher priority (ascending) (if ascending, undefined will appear on the beginning of the list)
      • 1: Undefined values will be sorted with lower priority (descending) (if ascending, undefined will appear on the end of the list)

      FiltersColumnDef

      Configures filtering behavior for columns. Properties control whether filtering is enabled, the filter function to use, and filter metadata. See Column Filtering.

      PropType
      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>
      Type
      boolean
      Description
      Enables/disables the column filter for this column.
      Type
      boolean
      Description
      Enables/disables the global filter for this column.
      Type
      FilterFnOption<TData>
      Description
      The filter function to use with this column. Can be the name of a built-in filter function or a custom filter function.

      ColumnSizingColumnDef

      Configures column sizing behavior. Properties control minimum and maximum widths, default size, and whether the column can be resized. See Column Sizing.

      PropType
      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
      Type
      boolean
      Description
      Enables or disables column resizing for the column.
      Type
      number
      Description
      The maximum allowed size for the column
      Type
      number
      Description
      The minimum allowed size for the column
      Type
      number
      Description
      The desired size for the column

      GroupingColumnDef

      Configures grouping behavior for columns. Properties control whether the column can be grouped, aggregation functions, and how grouped cells display. See Column Grouping.

      PropType
      The cell to display each row for the column if the cell is an aggregate.
      | string
      | ((
      props: CellContext<
      TData,
      TValue
      >,
      ) => any)
      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.
        (
        row: TData,
        ) => any
        Type
        | string
        | ((
        props: CellContext<
        TData,
        TValue
        >,
        ) => any)
        Description
        The cell to display each row for the column if the cell is an aggregate.
        Type
        AggregationFnOption<TData>
        Description
        The resolved aggregation function for the column.
        Type
        boolean
        Description
        Enables/disables grouping for this column.
        Type
        (
        row: TData,
        ) => any
        Description
        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.

          VisibilityColumnDef

          Configures column visibility behavior. Properties control whether columns can be hidden by users and whether they are visible by default. See Column Visibility.

          PropType
          Enables/Disables hiding the column.
          boolean
          Type
          boolean
          Description
          Enables/Disables hiding the column.
          Updated by Ryan Bower