Skip to content

Interface: ColumnDef\<TRow\>

Defined in: src/model/types.ts:54

Definition of a single grid column.

Later milestones extend this interface with pinning and column group options.

Type Parameters

TRow

TRow

Properties

accessor?

optional accessor?: keyof TRow | ((row) => unknown)

Defined in: src/model/types.ts:63

How to read this column’s value from a row: a key of TRow, or a function. When omitted, id is used as the key.


aggregate?

optional aggregate?: AggregateType | ((values) => unknown)

Defined in: src/model/types.ts:122

Aggregation function for group/parent rows.


aggregateFormatter?

optional aggregateFormatter?: (value) => ReactNode

Defined in: src/model/types.ts:124

Optional formatter for group/footer aggregate values.

Parameters

value

unknown

Returns

ReactNode


cell?

optional cell?: (context) => ReactNode

Defined in: src/model/types.ts:65

Custom cell renderer. Receives cell context, returns React content.

Parameters

context

CellContext<TRow>

Returns

ReactNode


cellClass?

optional cellClass?: (ctx) => string | undefined

Defined in: src/model/types.ts:130

Returns a class string to apply to this column’s cells, computed per-row. Receives the same CellContext<TRow> as cell. Return undefined for the default class set.

Parameters

ctx

CellContext<TRow>

Returns

string | undefined


cellStyle?

optional cellStyle?: (ctx) => CSSProperties | undefined

Defined in: src/model/types.ts:136

Returns inline style overrides for this column’s cells, computed per-row. Receives the same CellContext<TRow> as cell. Return undefined for the default styles.

Parameters

ctx

CellContext<TRow>

Returns

CSSProperties | undefined


editable?

optional editable?: boolean | ((row) => boolean)

Defined in: src/model/types.ts:112

Whether this column is editable. Default: false.


editor?

optional editor?: (ctx) => ReactNode

Defined in: src/model/types.ts:116

Custom editor component. Takes precedence over editorType.

Parameters

ctx

EditorContext<TRow>

Returns

ReactNode


editorOptions?

optional editorOptions?: Record<string, unknown>

Defined in: src/model/types.ts:118

Editor options (e.g., choices for select editor).


editorType?

optional editorType?: EditorType

Defined in: src/model/types.ts:114

Built-in editor type.


filter?

optional filter?: false | ColumnFilterConfig

Defined in: src/model/types.ts:104

Filter configuration for this column. Accepts:

  • 'text' — case-insensitive substring matching (default text operators)
  • 'number' — numeric comparison (default number operators)
  • { type, operators?, ... } — typed config: text | number | select | boolean | date. Constrains the filter UI and emitted operators
  • false — disable filtering

Defaults to false (no filter). See ColumnFilterConfig for the full object shape.


flex?

optional flex?: number

Defined in: src/model/types.ts:79

Grow factor — when set, this column absorbs a share of the leftover horizontal space (container width minus the sum of all fixed-width columns). Multiple flex columns split the remainder by ratio. Honors minWidth and maxWidth. The user explicitly resizing a flex column converts it to fixed width.


header: ReactNode

Defined in: src/model/types.ts:58

Header content — a string or any React node.


id

id: string

Defined in: src/model/types.ts:56

Unique, stable column id.


isTreeColumn?

optional isTreeColumn?: boolean

Defined in: src/model/types.ts:86

Marks this column as the tree column — the one that shows the hierarchy (depth indentation and the expand/collapse control). Tree mode only; exactly one column should set it. If none does, the first column is used and a development warning is emitted.


maxWidth?

optional maxWidth?: number

Defined in: src/model/types.ts:71

Maximum column width in pixels. Only honored when flex is set.


minWidth?

optional minWidth?: number

Defined in: src/model/types.ts:69

Minimum column width in pixels. Defaults to MIN_COLUMN_WIDTH.


pin?

optional pin?: "left" | "right"

Defined in: src/model/types.ts:110

Pins (freezes) this column to the left or right edge of the grid. Pinned columns are always visible and never column-virtualized. Defaults to unpinned (center).


sortable?

optional sortable?: boolean

Defined in: src/model/types.ts:91

Whether this column is sortable. Defaults to true. Set to false to disable sorting for this column.


validate?

optional validate?: Validator<TRow> | Validator<TRow>[]

Defined in: src/model/types.ts:120

Validation rules for this column.


width?

optional width?: number

Defined in: src/model/types.ts:67

Fixed column width in pixels. Defaults to DEFAULT_COLUMN_WIDTH.