A collection of loading spinners animated with CSS
Arguments
- uiOutput
An output element to be wrapped within a spinner.
- type
Type of spinner to use. Any number or string between
1and8(or"1"and"8") is valid.- color
Color of the spinner. Choose between a color name, hexadecimal, or
rgb()/rgba()/hsl()/hsla()values. Names use R'scolors()values (so"green"is#00FF00); CSS colour names not in R (such as"rebeccapurple") are also accepted.
Value
useSpinners() returns an HTML dependency to include in the UI;
spinners() returns a Shiny tag list wrapping uiOutput.
Examples
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
useSpinners(),
actionButton("render", "Render"),
spinners(plotOutput("plot"))
),
server = function(input, output) {
output$plot <- renderPlot({
input$render
Sys.sleep(3)
hist(mtcars$mpg)
})
}
)
}