Skip to main content

ColumnDef

ColumnDef<TRow> describes one column. Only field and headerName are required.

Identity and layout​

FieldTypeDefaultDescription
fieldstringRequiredRow key and column identity.
headerNamestringRequiredHeader label.
typeColumnType'string'Value type.
widthnumber140Fixed width.
minWidthnumber96Minimum width.
flexnumberNoneShare of the remaining width.
align'left' | 'center' | 'right'NoneCell alignment.
headerAlign'left' | 'center' | 'right'NoneHeader alignment.

Behavior​

FieldTypeDefaultDescription
sortablebooleantrueAllows sorting.
filterablebooleantrueAllows filtering.
hideablebooleantrueListed in the column menu.
searchablebooleantrueIncluded in global search.

Values and rendering​

FieldTypeDescription
valueGetter(row: TRow) => unknownDerives the value.
valueFormatter(value: unknown, row: TRow) => stringFormats the value.
renderCell(params: CellRenderParams<TRow>) => ReactNodeCustom cell.
renderHeader(params: HeaderRenderParams<TRow>) => ReactNodeCustom header.
sortComparator(a: unknown, b: unknown, rowA: TRow, rowB: TRow) => numberCustom sort.

Filter options​

FieldTypeDescription
filterOperatorsFilterOperator<TRow>[]Operators for this column.
filterSelectOptionsFilterSelectOption[]Picker values.
filterSelectMultiplebooleanAllows several values.
filterForceOperatorstringAlways uses this operator value.
filterHideOperatorbooleanHides the operator picker.

Actions​

FieldTypeDescription
actionsGridRowActionsSource<TRow>Items for a type: 'actions' column.
actionTriggerGridActionCellTriggerIcon, label, and display of the cell.