Single element CSS loading animation.
Arguments
- uiOutput
An output element to be wrapped within a loader.
- type
The type of animation to use. Visit https://nzbin.github.io/three-dots/ for details.
- color
The color of the loader. Choose between a color name, hexadecimal, or
rgb()/rgba()/hsl()/hsla()values. Names use R'scolors()values; CSS colour names not in R are also accepted.
Value
useThreeDots() returns an HTML dependency to include in the UI;
threeDots() returns a Shiny tag list wrapping uiOutput.
Examples
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
useThreeDots(),
actionButton("render", "Render"),
threeDots(plotOutput("plot"))
),
server = function(input, output) {
output$plot <- renderPlot({
input$render
Sys.sleep(3)
hist(mtcars$mpg)
})
}
)
}