gridcn2.0.0
Cheatsheets and messages

Props A to Z

Find a grid prop or column field by name, read what it does, and open the page that explains it.

Each table lists the props of one type in alphabetical order. Callbacks are on Events A to Z, and add-on options are on Options A to Z.

Provider props

Props of DataGrid, DataGridProvider.

PropPurposePage
announceResultsAnnounces the view's row count through the grid's live region after a filter, sort, or filter-group change.Live region messages
autosizeOnMountFits the column widths once after mount, when the view first has rows.Column sizing
cellTypesCustom cell types keyed by ColumnDef.type. Built-in types that you do not name keep working.CellType contract
checkedRowsLifetimeHow long the checked rows last.Checked rows
columnGroupsShared headers above runs of columns, by column id. Groups nest.Column headers and groups
columnLayoutThe layout that your code controls.Column and viewport events
columnsThe column definitions of the grid.Define columns
commandsYour own keyboard commands, keyed by name. A keymap binding that names no built-in action runs one.Plugin commands and shortcuts
createRowBuilds the new row for insertRow and insertRows. Without it, both return the reason "no-factory".Row operations
dataThe rows, controlled by your code.Data change events
defaultColumnLayoutThe layout, seeded once at mount.Column and viewport events
defaultDataThe rows, seeded once and then owned by the grid.Data change events
defaultExpandedSeeds the open groups once at store creation.DataGrid props
defaultFilterJoinThe join of the top-level filters, seeded once.Sort and filter events
defaultFilterStateThe filters, seeded once.Sort and filter events
defaultGroupBySeeds the group columns once at store creation.DataGrid props
defaultPageSeeds the page of a paged grid once. Default 1.Client pagination
defaultPageSizeSeeds the page size once and turns paging on. The grid keeps all of data and shows one page of the view.Client pagination
defaultSearchTextThe quick search text, seeded once.Sort and filter events
defaultSelectionThe selection, seeded once.Selection and cell events
defaultSortStateThe sort, seeded once.Sort and filter events
duplicateRowBuilds the new row for duplicateRows from the source row and its new data index.Row operations
enableColumnPinningTurns on pinning grid-wide. Default true. false makes setColumnPin do nothing.Column order and pinning
enableColumnReorderEnables drag-to-reorder columns grid-wide. Default true. false makes setColumnOrder do nothing.Column order and pinning
enableColumnResizeEnables the header resize handle grid-wide. Default true.Column sizing
enableColumnSelectionTurns on whole-column selection by a header click. Default true.Pointer selection
enableMultiRangeTurns on several ranges by Ctrl or Cmd click. Default true.Pointer selection
enableRangeSelectionTurns on range selection by shift-click, drag, and shift+arrow keys. Default true.Pointer selection
enableRowDeleteWhether the delete-rows key deletes. Default true.Row operations
enableRowSelectionTurns on whole-row selection by a row marker click and Shift+Space. Default true.Row markers
expandedControlled open groups.DataGrid props
fetchFilterValuesSupplies the values of the header filter popover and the isAnyOf input from a backend, one list per search.Header filter
filterJoinThe join of the top-level filters, controlled by your code.Sort and filter events
filterModeWho filters: "client" filters data, "server" only tracks the filters. Default "server" with totalRowCount, else "client".Sort and filter events
filterStateThe filter tree, controlled by your code.Sort and filter events
gateTimeoutMsAborts an async gate that has not settled after this many ms. Default: off.Gate cancellation and timeouts
getRowIdStable, unique id of a row.DataGrid props
groupByControlled group columns, outermost first.DataGrid props
groupLayoutThe group rows of a server grid, laid out by the server hook.DataGrid props
groupMode"server" shows the group rows of groupLayout and never buckets rows.DataGrid props
headerClickBehaviorSets what a plain header click does. Default "select".Pointer selection
inputDebounceMsSets the wait in ms before a text input commits. It covers the toolbar search, the filter value inputs, the set-filter search, find and replace, and the lookup editor.Quick search
keymapMerges over DEFAULT_KEYMAP per action. An action mapped to [] has no binding.Shortcut remapping
labelsOverrides the UI text. The grid deep-merges it over DEFAULT_LABELS.Labels and i18n
localeBCP 47 language tag, such as "de-DE".Labels and i18n
pageThe current page, 1-based.Client pagination
pageSizeShows pageSize rows of the sorted and filtered view at a time.Client pagination
pageSizeOptionsLists the page sizes that the footer select offers. DataGridPaginationBar and useDataGridPager read it, and an option on either wins.DataGrid props
pluginsInstalls plugins: overlay layers, row bands, data-change observers, commands, keymap bindings, and root mounts.Plugin model
processCellForClipboardOverrides a cell's clipboard-copy text.Change copy and paste
processCellFromClipboardOverrides parsing pasted text into a cell value.Change copy and paste
processPasteRuns on the parsed paste grid before it is applied. Returning false (or a promise of false) vetoes the paste entirely.Change copy and paste
readOnlyBlocks edits, paste, fill, cut, clear, row operations, id swaps, undo, and redo in the whole grid. A source: "stream" push still writes. Default false.Editable columns
resolveSaveConflictDecides what a refused row becomes when the server sent its current row (SaveRejection.current).Handle refused saves
rowMarkersSets the mode of the marker column. Default "none".Row markers
sanitizeClipboardFormulasPrefixes formula-like copied cells with ' in the clipboard text and HTML. Default true. false copies raw text.Clipboard
saveTimeoutMsRefuses a save that has not settled after this many ms.Data change events
searchTextThe quick search text, controlled by your code.Sort and filter events
selectionThe selection, controlled by your code.Selection and cell events
sortLocaleThe language tag for text compares in a client sort, text range filters, and the filter value lists.Sort and filter events
sortModeWho sorts: "client" sorts data, "server" only tracks the sort. Default "server" with totalRowCount, else "client".Sort and filter events
sortStateThe sort, controlled by your code.Sort and filter events
totalRowCountDeclares that data is a window of a larger result of this many rows. null means the size is unknown.Server rows contract
validateRowValidates a whole row once after a write gesture commits. The row already has every cell of the gesture applied.Row validation and async checks

Root props

Props of DataGrid, DataGridRoot.

PropPurposePage
aria-labelAccessible name of the grid.DataGrid props
aria-labelledbyId of the element that names the grid.DataGrid props
childrenThe parts inside the root.DataGrid props
classNameClasses for the scroll root.DataGrid props
columnOverscanUnpinned columns that render past each side of the view.DataGrid props
densityRow height preset: 28, 36, or 44 px.DataGrid props
directionLayout direction.DataGrid props
emptyStateContent for a view with no rows.DataGrid props
errorAny value except undefined and null shows the error state.DataGrid props
errorStateReplaces the built-in error state.DataGrid props
getCellClassNameAdds classes to a cell.DataGrid props
getRowClassNameAdds classes to a row.DataGrid props
headerHeightHeight of one header row in px.DataGrid props
loadingShows the loading skeleton or the loading bar.DataGrid props
loadingStateReplaces the built-in loading display.DataGrid props
markerWidthMarker track width in px. It overrides the width of the rowMarkers mode. rowMarkers="none" ignores it.DataGrid props
renderGroupLabelRenders the content of a group row label. The default is "column: key".DataGrid props
renderHeaderFilterRenders the header filter in each column that offers a set filter (isAnyOf or isNoneOf) and is not filterable: false.DataGrid props
renderHeaderMenuRenders a menu trigger in each header cell.DataGrid props
renderMarkerReplaces the content of a row marker cell.DataGrid props
renderMarkerHeaderReplaces the select-all checkbox of the marker header.DataGrid props
rowHeightRow height in px.DataGrid props

Column fields

Props of ColumnDef.

PropPurposePage
accessorFnComputes the value from the row.ColumnDef
accessorKeyRow field that holds the value.ColumnDef
aggregateReduces this column over each row group. The group row shows the result.ColumnDef
cellClassNameAdds classes to every cell of the column.ColumnDef
filterSets the filter capabilities of this column.ColumnDef
filterablefalse removes the column from the filter column picker and the header filter.ColumnDef
flexShare of the free width of the grid.ColumnDef
groupableLets the grid group by this column.ColumnDef
headerA string header shows a sort arrow while the column is sorted, also on a sortable: false column.ColumnDef
headerClassNameAdds classes to the header cell.ColumnDef
headerTextPlain-text name for a node header.ColumnDef
hiddentrue hides the column when its id first appears.ColumnDef
hideablefalse turns off the column row in the columns menu while the column is visible and removes "Hide column" from the header menu.ColumnDef
idStable identity of the column.ColumnDef
maxWidthLargest width in px.ColumnDef
minWidthSmallest width in px.ColumnDef
optionsSettings for the cell type, such as the choices of a select.ColumnDef
pinStarting pin side, applied when the column id first appears.ColumnDef
pinnablefalse turns off pin and unpin.ColumnDef
readOnlyBlocks edits.ColumnDef
renderCellReplaces how the cell looks.ColumnDef
reorderablefalse stops the drag of this column.ColumnDef
resizablefalse removes the resize handle and leaves the column out of autosize.ColumnDef
setValueReturns a new row with the value written.ColumnDef
sortablefalse removes the column from header-click sorting, the sort list, and the sort items of the header menu.ColumnDef
sortCompareCompares two rows for sorting.ColumnDef
sortIndicatorDraws the built-in sort arrow in the header, for string and node headers alike.ColumnDef
typeKey of the cell type.ColumnDef
validateRejects a value.ColumnDef
validateManyValidates every cell of this column that one write sets in one call (null accepts), after validate. One answer per cell, in order.ColumnDef
validationModeWhat a rejection does to a commit: a single-cell edit, a paste, a fill, updateCells, an import, Delete, and Cut.ColumnDef
widthWidth in px.ColumnDef

On this page