Black Lives Matter. Please consider donating to Black Girls Code today.

Loading state with message

The loading state feature of Dash is great - I was just wondering if its possible to have a little message with the loading screen?
For instance, I have a loading state after a ‘submit’ which is a full screen graph graphic and it would be great if I could write underneath the animation something like: “Loading data XX for years YYYY and YYYY”
Is this possible? Is this something that would be done via CSS?
Or even better something that changed as more data was loaded: “Loading data XX for year YYYY” where YYYY updated as the data was loaded?

Thanks!

Hi @dig, you could have an html.Div above or below your graph, which would be an output in the same callback as the one updating the graph. The html.Div would have a message which would not be visible by default thanks to CSS, and you could make use of the data-dash-is-loading attribute of the Div to change its color so that it becomes visible, like what is described at the end of https://dash.plot.ly/loading-states. However, I don’t know how to change the content of the message…

1 Like

Thanks! I’ll give this a go!