# with timeout ------------------------------------------------------------
library(shiny)
library(shinybusy)
ui <- fluidPage(
busy_start_up(
loader = spin_epic("orbit", color = "#FFF"),
text = "Loading...",
timeout = 1500,
color = "#FFF",
background = "#112446"
),
tags$h1("Ready to play!", class = "text-center")
)
server <- function(input, output, session) {
}
if (interactive())
shinyApp(ui, server)
# manual ------------------------------------------------------------------
library(shiny)
library(shinybusy)
ui <- fluidPage(
busy_start_up(
loader = spin_kit(
spin = "cube-grid",
color = "#FFF",
style = "width:50px; height:50px;"
),
text = "Loading...",
mode = "manual",
color = "#FFF",
background = "#112446"
),
tags$h1("Ready to play!", class = "text-center")
)
server <- function(input, output, session) {
# Remove after 3 seconds (+timeout)
observe({
Sys.sleep(3)
remove_start_up(timeout = 200)
})
}
if (interactive())
shinyApp(ui, server)
# auto & GIF --------------------------------------------------------------
library(shiny)
library(shinybusy)
ui <- fluidPage(
busy_start_up(
loader = tags$img(
src = "https://jeroen.github.io/images/banana.gif",
width = 100
),
text = "Loading...",
mode = "auto"
),
tags$h1("Ready to play!", class = "text-center"),
plotOutput(outputId = "plot")
)
server <- function(input, output, session) {
output$plot <- renderPlot({
Sys.sleep(2)
plot(rnorm(100))
})
}
if (interactive())
shinyApp(ui, server)
Run the code above in your browser using DataLab