Empty state
Use the emptyState prop of DataGrid to render content when there are no rows to display.
The content is rendered in a full-width cell without padding, use the emptyState Styles API
selector to style it. The empty state is not displayed while loading is set.
emptyState can be a React node or a function that receives the following object:
Loading
Set the loading prop on DataGrid to display the loading state:
- If the grid has no rows yet, skeleton rows are displayed
- If the grid has rows, the
loadingVariantprop defines what is displayed over them
Loading variants
The number of skeleton rows is the page size when pagination is enabled and skeletonRowCount
(10 by default) otherwise. Use loadingOverlayProps to pass props to LoadingOverlay
of the overlay variant:
In list view there are no skeleton rows, the skeleton variant displays the overlay instead.
Server-side example
The full server-side example uses loading with
loadingVariant="bar": skeleton rows are displayed on the first load and the bar is displayed
while a new page, sort or filter is fetched.