Data Grid - Overlays
The various data grid overlays.
Loading overlay
To display a loading overlay and signify that the data grid is in a loading state, set the loading
prop to true
.
The data grid supports 3 loading overlay variants out of the box:
circular-progress
(default): a circular loading spinner.linear-progress
: an indeterminate linear progress bar.skeleton
: an animated placeholder of the data grid.
The type of loading overlay to display can be set via slotProps.loadingOverlay
for the following two props:
variant
: whenloading
and there are rows in the table.noRowsVariant
: whenloading
and there are not any rows in the table.
<DataGrid
{...data}
loading
slotProps={{
loadingOverlay: {
variant: 'linear-progress',
noRowsVariant: 'skeleton',
},
}}
/>
Circular progress
A circular loading spinner, the default loading overlay.
Linear progress
An indeterminate linear progress bar.
Skeleton
An animated placeholder of the data grid.
Custom component
If you want to customize the no rows overlay, a component can be passed to the loadingOverlay
slot.
In the following demo, a labelled determinate CircularProgress component is rendered in place of the default loading overlay, with some additional Loading rows… text.
No rows overlay
The no rows overlay is displayed when the data grid has no rows.
Custom component
If you want to customize the no rows overlay, a component can be passed to the noRowsOverlay
slot and rendered in place.
In the following demo, an illustration is added on top of the default "No rows" message.
No results overlay
The no results overlay is displayed when the data grid has no results after filtering.
Custom component
If you want to customize the no results overlay, a component can be passed to the noResults
slot and rendered in place.
In the following demo, an illustration is added on top of the default "No results found" message.