The row type.
The context type.
OptionalalignHorizontal alignment of the cell content.
OptionalcellExtra classes on every cell, optionally per row.
OptionalcellRender the cell as markup. Presentation only — sorting and filtering still
use field, so a decorated cell keeps behaving like a plain one.
OptionalcolStable identity, used as the key in the sort and filter models and in persisted layout. Falls back to field when omitted; one of the two is required.
OptionaleditableWhether the cell can be edited, optionally per row.
OptionaleditorWhich editor to use: a BuiltinEditor name or your own component.
OptionaleditorExtra options for the editor named by ColumnDef.editor.
Optionaloptions?: SelectOption[]Choices for the select editor.
Optionalplaceholder?: stringPlaceholder for the text and number editors.
OptionalexportThe flat string written to CSV and the clipboard. Supply this whenever ColumnDef.cellRenderer produces markup.
OptionalfieldDotted path into the row ('customer.name'), and the key sent to the
server for sorting and filtering.
Omit it for purely derived columns and supply colId plus
valueGetter instead.
OptionalfieldAlternative flat keys to try when the server flattens nested fields — some
backends return {"customer.name": x} rather than a nested object, and
change the prefix when grouping is on.
OptionalfilterWhich filter UI to offer, or false for none.
OptionalfilterExtra options for the filter named by ColumnDef.filter.
OptionalsuppressFloatingFilter?: booleanHide the always-visible filter input under the header for this column.
Optionalvalues?: string[] | (() => Promise<string[]>)Options for a set filter: a static list, or a function called the first
time the popover opens so the list can come from an API.
OptionalflexShare of the leftover horizontal space, like flex-grow. A column with
flex: 2 takes twice the slack of one with flex: 1.
Header content. Any node — an icon, a tooltip wrapper, anything.
OptionalheaderExtra classes on the header cell.
OptionalheaderPlain-text header for exports and aria labels. Required in practice
whenever header is a node rather than a string.
OptionalhideStart hidden. The user can still reveal it from the columns panel.
OptionallockPrevent the user dragging this column out of position.
OptionalmaxCeiling for user resizing.
OptionalminFloor for both flex and user resizing.
OptionalpinnedStick this column to an edge while the rest scroll horizontally.
OptionalresizableAllow drag-to-resize.
OptionalsortableAllow click-to-sort on the header.
OptionalsuppressLeave this column out of CSV and clipboard output entirely.
OptionalvalueTurn the raw value into its display string. Also used for exports unless ColumnDef.exportValue is given.
OptionalvalueCompute the cell value instead of reading field. Takes precedence over
every other lookup.
OptionalwidthStarting width in pixels.
One column. This is the main thing you write when using the grid.
Example: A representative set of columns
Remarks
Define columns as a module constant or memoise on
[]. Anything volatile belongs in DataGridProps.context instead, which reaches every renderer without rebuilding a single definition.