interface ColumnConfig<T = unknown> {
    Cell?: ComponentLike;
    key: string;
    name?: string;
    options?: (context: CellContext<T>) => CellOptions;
    pluginOptions?: [
        Plugin<unknown>
        | Constructor<Plugin<unknown>>,
        () => unknown,
    ][];
    value?: (context: CellContext<T>) => ContentValue;
}

Type Parameters

  • T = unknown

Properties

Cell?: ComponentLike

Recommended property to use for custom components for each cell per column. Out-of-the-box, this property isn't used, but the provided type may be a convenience for consumers of the headless table

key: string

the key is required for preferences storage, as well as managing uniqueness of the columns in an easy-to-understand way.

key may be anything if a value is provided, but should be a property-path on each data object passed to the table.

`someObj.property.path`
`someProperty`
name?: string

The name or title of the column, shown in the column heading / th

options?: (context: CellContext<T>) => CellOptions

Bag of extra properties to pass to Cell via @options, if desired

pluginOptions?: [Plugin<unknown> | Constructor<Plugin<unknown>>, () => unknown][]

Each plugin may provide column options, and provides similar syntax to how options for the table are specified in the plugins entry,

pluginOptions: [
ColumnVisibility.forColumn(() => ({ isVisible: false })),
StickyColumns.forColumn(() => ({ sticky: 'right' })),
],
value?: (context: CellContext<T>) => ContentValue

Optionally provide a function to determine the value of a row at this column