Optional
apiThe ref object that allows grid manipulation. Can be instantiated with useGridApiRef()
.
Optional
aria-The label of the Data Grid.
Optional
aria-The id of the element containing a label for the Data Grid.
Optional
autoIf true
, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
Optional
autoIf true
, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
Optional
autosizeIf true
, columns are autosized after the datagrid is mounted.
Optional
autosizeThe options for autosize when user-initiated.
Optional
cellControls the modes of the cells.
Optional
checkboxIf true
, the Data Grid will display an extra column with checkboxes for selecting rows.
Optional
checkboxIf true
, the "Select All" header checkbox selects only the rows on the current page. To be used in combination with checkboxSelection
.
It only works if the pagination is enabled.
Optional
classesOverride or extend the styles applied to the component.
Optional
classOptional
clipboardThe character used to separate cell values when copying to the clipboard.
Optional
columnColumn region in pixels to render before/after the viewport
Optional
columnSets the height in pixels of the column group headers in the Data Grid.
Inherits the columnHeaderHeight
value if not set.
Optional
columnOptional
columnSets the height in pixel of the column headers in the Data Grid.
Set of columns of type [[GridColDef]][].
Optional
columnSet the column visibility model of the Data Grid.
If defined, the Data Grid will ignore the hide
property in [[GridColDef]].
Optional
defaultIf above 0, the row children will be expanded up to this depth. If equal to -1, all the row children will be expanded.
Optional
densitySet the density of the Data Grid.
Optional
detailThe row ids to show the detail panel.
Optional
disableIf true
, column autosizing on header separator double-click is disabled.
Optional
disableIf true
, the filtering will only be applied to the top level rows when grouping rows with the treeData
prop.
Optional
disableIf true
, the sorting will only be applied to the top level rows when grouping rows with the treeData
prop.
Optional
disableIf true
, column filters are disabled.
Optional
disableIf true
, the column menu is disabled.
Optional
disableIf true
, the column pinning is disabled.
Optional
disableIf true
, reordering columns is disabled.
Optional
disableIf true
, resizing columns is disabled.
Optional
disableIf true
, hiding/showing columns is disabled.
Optional
disableIf true
, the column sorting feature will be disabled.
Optional
disableIf true
, the density selector is disabled.
Optional
disableIf true
, eval()
is not used for performance optimization.
Optional
disableIf true
, filtering with multiple columns is disabled.
Optional
disableIf true
, the sorting with multiple columns is disabled.
Optional
disableIf true
, multiple selection using the Ctrl/CMD or Shift key is disabled.
The MIT DataGrid will ignore this prop, unless checkboxSelection
is enabled.
Optional
disableIf true
, the selection on click on a row or cell is disabled.
Optional
disableIf true
, the virtualization is disabled.
Optional
editControls whether to use the cell or row editing.
Optional
estimatedUse if the actual rowCount is not known upfront, but an estimation is available.
If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
Applicable only with paginationMode="server"
and when rowCount="-1"
Optional
experimentalUnstable features, breaking changes might be introduced.
For each feature, if the flag is not explicitly set to true
, the feature will be fully disabled and any property / method call will not have any effect.
Optional
filterThe milliseconds delay to wait after a keystroke before triggering filtering.
Optional
filterFiltering can be processed on the server or client-side. Set it to 'server' if you would like to handle filtering on the server-side.
Optional
filterSet the filter model of the Data Grid.
Optional
getFunction that applies CSS classes dynamically on cells.
With all properties from [[GridCellParams]].
The CSS class to apply to the cell.
Optional
getFunction that returns the element to render in row detail.
With all properties from [[GridRowParams]].
The row detail element.
Optional
getFunction that returns the height of the row detail panel.
With all properties from [[GridRowParams]].
The height in pixels or "auto" to use the content height.
Optional
getFunction that returns the estimated height for a row. Only works if dynamic row height is used. Once the row height is measured this value is discarded.
With all properties from [[GridRowHeightParams]].
The estimated row height value. If null
or undefined
then the default row height, based on the density, is applied.
Optional
getFunction that applies CSS classes dynamically on rows.
With all properties from [[GridRowClassNameParams]].
The CSS class to apply to the row.
Optional
getFunction that sets the row height per row.
With all properties from [[GridRowHeightParams]].
The row height value. If null
or undefined
then the default row height is applied. If "auto" then the row height is calculated based on the content.
Optional
getReturn the id of a given [[GridRowModel]]. Ensure the reference of this prop is stable to avoid performance implications. It could be done by either defining the prop outside of the component or by memoizing it.
Optional
getFunction that allows to specify the spacing between rows.
With all properties from [[GridRowSpacingParams]].
The row spacing values.
Optional
getDetermines the path of a row in the tree data. For instance, a row with the path ["A", "B"] is the child of the row with the path ["A"]. Note that all paths must contain at least one element.
The row from which we want the path.
The path to the row.
Optional
groupingThe grouping column used by the tree data.
Optional
headerOverride the height of the header filters.
Optional
headerIf true
, the header filters feature is enabled.
Optional
hideIf true
, the footer component is hidden.
Optional
hideIf true
, the pagination component in the footer is hidden.
Optional
hideIf true
, the row count in the footer is hidden.
It has no effect if the pagination is enabled.
Optional
hideIf true
, the selected row count in the footer is hidden.
Optional
ignoreIf true
, the diacritics (accents) are ignored when filtering or quick filtering.
E.g. when filter value is cafe
, the rows with café
will be visible.
Optional
ignoreIf true
, the Data Grid will not use valueFormatter
when exporting to CSV or copying to clipboard.
If an object is provided, you can choose to ignore the valueFormatter
for CSV export or clipboard export.
Optional
indeterminateIf select
, a group header checkbox in indeterminate state (like "Select All" checkbox)
will select all the rows under it.
If deselect
, it will deselect all the rows under it.
Works only if checkboxSelection
is enabled.
Optional
initialThe initial state of the DataGridPro.
The data in it will be set in the state on initialization but will not be controlled.
If one of the data in initialState
is also being controlled, then the control state wins.
Optional
isCallback fired when a cell is rendered, returns true if the cell is editable.
With all properties from [[GridCellParams]].
A boolean indicating if the cell is editable.
Optional
isDetermines if a group should be expanded after its creation.
This prop takes priority over the defaultGroupingExpansionDepth
prop.
The node of the group to test.
A boolean indicating if the group is expanded.
Optional
isDetermines if a row can be selected.
With all properties from [[GridRowParams]].
A boolean indicating if the row is selectable.
Optional
keepIf true
, moving the mouse pointer outside the grid before releasing the mouse button
in a column re-order action will not cause the column to jump back to its original position.
Optional
keepIf true
, the selection model will retain selected rows that do not exist.
Useful when using server side pagination and row selections need to be retained
when changing pages.
Optional
loadingIf true
, a loading overlay is displayed.
Optional
localeSet the locale text of the Data Grid. You can find all the translation keys supported in the source in the GitHub repository.
Optional
loggerPass a custom logger in the components that implements the [[Logger]] interface.
Optional
logAllows to pass the logging level or false to turn off logging.
Optional
nonceNonce of the inline styles for Content Security Policy.
Optional
onCallback fired when any cell is clicked.
Optional
onCallback fired when a double click event comes from a cell element.
Optional
onCallback fired when the cell turns to edit mode.
Optional
onCallback fired when the cell turns to view mode.
Optional
onCallback fired when a keydown event comes from a cell element.
Optional
onCallback fired when the cellModesModel
prop changes.
Object containing which cells are in "edit" mode.
Additional details for this callback.
Optional
onCallback called when the data is copied to the clipboard.
Optional
onCallback fired when a click event comes from a column header element.
Optional
onCallback fired when a contextmenu event comes from a column header element.
Optional
onCallback fired when a double click event comes from a column header element.
Optional
onCallback fired when a mouse enter event comes from a column header element.
Optional
onCallback fired when a mouse leave event comes from a column header element.
Optional
onCallback fired when a mouseout event comes from a column header element.
Optional
onCallback fired when a mouseover event comes from a column header element.
Optional
onCallback fired when a column is reordered.
Optional
onCallback fired while a column is being resized.
Optional
onCallback fired when the column visibility model changes.
The new model.
Additional details for this callback.
Optional
onCallback fired when the width of a column is changed.
Optional
onCallback fired when the density changes.
New density value.
Optional
onCallback fired when the detail panel of a row is opened or closed.
The ids of the rows which have the detail panel open.
Additional details for this callback.
Optional
onCallback fired when rowCount is set and the next batch of virtualized rows is rendered.
Optional
onCallback fired when the Filter model changes before the filters are applied.
With all properties from [[GridFilterModel]].
Additional details for this callback.
Optional
onCallback fired when the menu is closed.
Optional
onCallback fired when the menu is opened.
Optional
onCallback fired when the pagination meta has changed.
Updated pagination meta.
Optional
onCallback fired when the pagination model has changed.
Updated pagination model.
Additional details for this callback.
Optional
onCallback fired when the pinned columns have changed.
The changed pinned columns.
Additional details for this callback.
Optional
onCallback fired when the preferences panel is closed.
Optional
onCallback fired when the preferences panel is opened.
Optional
onCallback called when processRowUpdate
throws an error or rejects.
The error thrown.
Optional
onCallback fired when the Data Grid is resized.
Optional
onCallback fired when a row is clicked. Not called if the target clicked is an interactive element added by the built-in columns.
Optional
onCallback fired when the row count has changed.
Updated row count.
Optional
onCallback fired when a double click event comes from a row container element.
Optional
onCallback fired when the row turns to edit mode.
Optional
onCallback fired when the row turns to view mode.
Optional
onCallback fired when the rowModesModel
prop changes.
Object containing which rows are in "edit" mode.
Additional details for this callback.
Optional
onCallback fired when a row is being reordered.
Optional
onCallback fired when the selection state of one or multiple rows changes.
With all the row ids [[GridSelectionModel]].
Additional details for this callback.
Optional
onCallback fired when scrolling to the bottom of the grid viewport.
Optional
onCallback fired when the sort model changes before a column is sorted.
With all properties from [[GridSortModel]].
Additional details for this callback.
Optional
pageSelect the pageSize dynamically using the component UI.
Optional
paginationIf true
, pagination is enabled.
Optional
paginationThe extra information about the pagination state of the Data Grid.
Only applicable with paginationMode="server"
.
Optional
paginationPagination can be processed on the server or client-side. Set it to 'client' if you would like to handle the pagination on the client-side. Set it to 'server' if you would like to handle the pagination on the server-side.
Optional
paginationThe pagination model of type [[GridPaginationModel]] which refers to current page
and pageSize
.
Optional
pinnedThe column fields to display pinned to left or right.
Optional
pinnedRows data to pin on top or bottom.
Optional
processCallback called before updating a row with new values in the row and cell editing.
Optional
resetIf true
, the page is set to 0 after each sorting or filtering.
This prop will be removed in the next major version and resetting the page will become the default behavior.
Optional
resizeThe milliseconds throttle delay for resizing the grid.
Optional
rowRow region in pixels to render before/after the viewport
Optional
rowSet the total number of rows, if it is different from the length of the value rows
prop.
If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
Only works with paginationMode="server"
, ignored when paginationMode="client"
.
Optional
rowSets the height in pixel of a row in the Data Grid.
Optional
rowControls the modes of the rows.
Optional
rowThe milliseconds delay to wait after measuring the row height before recalculating row positions. Setting it to a lower value could be useful when using dynamic row height, but might reduce performance when displaying a large number of rows.
Optional
rowIf true
, the reordering of rows is enabled.
Optional
rowsSet of rows of type [[GridRowsProp]].
Optional
rowIf false
, the row selection mode is disabled.
Optional
rowSets the row selection model of the Data Grid.
Optional
rowWhen rowSelectionPropagation.descendants
is set to true
.
When rowSelectionPropagation.parents
is set to true
Works with tree data and row grouping on the client-side only.
Optional
rowsLoading rows can be processed on the server or client-side. Set it to 'client' if you would like enable infnite loading. Set it to 'server' if you would like to enable lazy loading. *
Optional
rowSets the type of space between rows added by getRowSpacing
.
Optional
scrollbarOverride the height/width of the Data Grid inner scrollbar.
Optional
scrollSet the area in px
at the bottom of the grid viewport where onRowsScrollEnd is called.
Optional
showIf true
, vertical borders will be displayed between cells.
Optional
showIf true
, vertical borders will be displayed between column header items.
Optional
slotOverridable components props dynamically passed to the component at rendering.
Optional
slotsOverridable components.
Optional
sortingSorting can be processed on the server or client-side. Set it to 'client' if you would like to handle sorting on the client-side. Set it to 'server' if you would like to handle sorting on the server-side.
Optional
sortingThe order of the sorting sequence.
Optional
sortSet the sort model of the Data Grid.
Optional
styleOptional
sxThe system prop that allows defining system overrides as well as additional CSS styles.
Optional
throttleIf positive, the Data Grid will throttle updates coming from apiRef.current.updateRows
and apiRef.current.setRows
.
It can be useful if you have a high update rate but do not want to do heavy work like filtering / sorting or rendering on each individual update.
Optional
treeIf true
, the rows will be gathered in a tree structure according to the getTreeDataPath
prop.
Optional
unstable_Optional
unstable_Optional
unstable_Definition of the column rendered when the unstable_listView
prop is enabled.
Optional
unstable_If true
, displays the data in a list view.
Use in combination with unstable_listColumn
.
Optional
unstable_Optional
unstable_If true
, the Data Grid will auto span the cells over the rows having the same value.
Optional
virtualizeIf true
, the Data Grid enables column virtualization when getRowHeight
is set to () => 'auto'
.
By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
For datasets with a large number of columns, this can cause performance issues.
The downside of enabling this prop is that the row height will be estimated based the cells that are currently rendered, which can cause row height change when scrolling horizontally.
The props users can give to the
DataGridProProps
component.