Hey i've just started working with R and Shiny. Trying to make a dashboard which displays different charts. As there is a lot of data to process, the plots or charts take some time to display after the action button is clicked i.e. "launch Campaign' Is there anyway i could show a spinning wheel or a loading icon in the white blank space, while this delay takes place? Dashboard with blank space on the right
Asked
Active
Viewed 2.6k times
30
-
2Have you looked into here: https://shiny.rstudio.com/gallery/progress-bar-example.html ? – Tonio Liebrand Mar 26 '18 at 09:38
-
This has been already covered here: https://stackoverflow.com/questions/26004302/shiny-app-busy-indicator Basically you are looking for conditionalPanel in the first approximation. – PSzczesny Mar 26 '18 at 09:42
-
1Possible duplicate of [shiny app busy indicator](https://stackoverflow.com/questions/26004302/shiny-app-busy-indicator) – PSzczesny Mar 26 '18 at 09:42
1 Answers
66
There is wonderful shinycssloaders
package https://github.com/andrewsali/shinycssloaders, now maintained here https://github.com/daattali/shinycssloaders, which does what you want:
library(shiny)
library(dplyr)
library(shinycssloaders)
ui <- fluidPage(
actionButton("plot","plot"),
plotOutput("Test") %>% withSpinner(color="#0dc5c1")
)
server <- function(input, output, session) {
data <- eventReactive(input$plot,{
rnorm(1:100000)
})
output$Test <- renderPlot({
plot(data())
})
}
shinyApp(ui = ui, server = server)

Pork Chop
- 28,528
- 5
- 63
- 77
-
4works with textOutput as well. Great Stuff! `textOutput("t1")%>% withSpinner(color="#0dc5c1")` – agent18 Jul 28 '19 at 10:03
-
3https://dreamrs.github.io/shinybusy/ IMO this is the easiest solution. Requires only one line of code – bodega18 Oct 20 '21 at 17:14
-