The Data Grid comes with placeholder content overlays that live within the contextual provider.
When provided, any component used for the overlay slot will have access to the Data Grid context
via the useDataGridContext hook.
You can utilize an overlay by adding the name of the slot as a property to the Data Grid overlays prop. Each overlay slot comes with a default fallback when no custom component is provided.
Overlay slots are placed within the grid viewport which is the body of the Data Grid
The noContent overlay appears when there are no rows to display in the Data Grid. This can be from providing an empty data Array or being filtered out via a feature or store action.
Pass a component to the overlays.noContent prop to display a custom overlay.
For convenience, the content is placed within a Center parent that matches the height of the viewport area.
The pending overlay appears when the Data Grid pending prop is set to true to signify the Grid is in a loading state.
The Data Grid supports 3 loading overlay variants out of the box:
For convenience, the content is placed within an absolutely positioned Box parent that matches the height of the viewport area and sits above the row content.
Pass 'skeleton' to the overlays.pending prop to display a skeleton pending overlay.
Pass 'linear' to the overlays.pending prop to display a linear-progress pending overlay.
Pass 'circular' to the overlays.pending prop to display a circular-progress pending overlay.
Pass a component to the overlays.loading prop to display a custom overlay.
For cell level pending states, you can take advantage of Suspense to provide column-level loading states if Promises are used within the Column Definition cell.
This is a natural resource provided by React (and Signals) that doesn't require any additional prop management on the Data Grid.
💡 "Wow! That was fast after the first click?!"
Yup! The Cerberus signals lib caches querys. Since the state saves a string, the cache is smart enough to know that a string of "success" already exists. Thus, it bypasses the fetch. If the strings where unique (or the data more complex) it would handle it accordingly.