-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] Skeleton for loading (replace circular progress?) #1685
Comments
At this point, it's an RFC, It's not clear what could yield the best UX. I could only find one benchmark. |
We should also consider when we already loaded rows and for some reason, the loading state comes up? New server call. |
I'm looking into having such special rows for the second part of the infinite loading feature #1247 because I need to have those skeleton rows in between loaded rows. I was thinking that we probably need to create a special kind of row? |
Just to add to the benchmark, we created a skeleton for the data grid in Toolpad. It adds some randomness to the length of the bars, and it respects cell alignment. It falls back to Edit: One way that this concept could be taken even further is to also consider the datatype of the columns and vary the randomness. e.g. for dates or numbers the length of the content may be more uniform across rows than for text |
Nice. I wonder do we need a skeleton per cell. We can use the new |
The way I understand it is that you'd use a skeleton instead of a spinner to minimize the visual interruption and layout shift when data is loaded. You try to resemble the expected final state as close as possible with the limited information available. That's what I aimed for with the Toolpad implementation and why I went for a skeleton per cell. I think looks better, but I wouldn't argue that it's an absolute requirement. |
Design-wise, on my end, it feels much better with one skeleton per cell than one per row.
Beautiful 😍 |
This comment was marked as resolved.
This comment was marked as resolved.
This would be a great feature!! Its already implemented via the Lazy loading https://mui.com/x/react-data-grid/row-updates/#lazy-loading, is it possible to turn this on as a loading overlay for a certain number of rows? This would mean UI consistency in datagrid loading skeletons. |
I would think it'd be useful to allow the user to pick between built-in loading screens as well as specify a custom one. Not sure on the details of course but something like
There's another level of complication here: I find I usually need to distinguish between two types of "loading" states: 1) initial load, where there's no data in the grid at all to display; and 2) refreshes/reloads, where the data is there but is briefly stale. (@dtassone I believe this is your ask as well.) I would love to turn on a grid skeleton for the first case (initial load). For the second case, I usually implement my own "reloading" state that just dials down the opacity. (Reloading is usually fairly quick and I just want a subtle indication that something is going on, but nothing visually jarring.) It would be cool if the DataGrid could distinguish between those two types of loading. |
In case it helps anyone, with the MUI X v6 update, there is now a "scrollPositionChange" GridEvent. You can make Janpots great answer look more natural by using the event to programatically scroll the loading skeleton overlay when the user scrolls the datagrid. The skeleton cells will stay inline with the header row. Updated example of x scrolling: https://codesandbox.io/s/customloadingoverlaygrid-material-demo-forked-c8xt5x?file=/demo.tsx |
Material React Table does a nice job with loading IMO. Looks pretty much like @coot3's version. (I prefer just the skeletons and not the spinner, but that's customizable.) |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
We already have skeleton rows with lazy loading: Should we have a different API to use it? |
@joserodolfofreitas It's not what
|
Implemented in #13293 |
@oliviertassinari: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Summary 💡
The central spinner when the data load and refreshes is not very nice.
Motivation 🔦
Instead of a loader, we could render a skeleton. To check with the designer.
Developers can customize it based on this demo: https://material-ui.com/components/data-grid/components/#loading-overlay.
Benchmarks
LinearProgress
when there already are rows. (codesandbox)One way that this concept could be taken even further is to also consider the data type of the columns and vary the randomness. e.g. for dates or numbers, the length of the content may be more uniform across rows than for text.
The text was updated successfully, but these errors were encountered: