Learn R Programming

nextGenShinyApps (version 2.1)

spinner: Create a spinner

Description

Create a loading spinner for customization of outputs

Usage

spinner(
  type = c("ring", "grow", "square", "rect"),
  size = c("l", "s"),
  color = c("default", "primary", "secondary", "info", "success", "danger", "warning")
)

Value

An HTML containing elements of a spinner to be embedded in a page during loading

Arguments

type

Choose a style for the spinner using "ring","grow","square","rect"

size

Size of the spinner, "l" for large and "s" for small

color

Color of the spinner, choose between "default", "primary", "secondary", "info", "success", "danger", "warning"

Examples

Run this code
# \donttest{
if (interactive()) {
  library(shiny)
  library(nextGenShinyApps)

  shiny::shinyApp(
    ui = fluidPage(
      style = "3",
      custom.bg.color = "cyan",
      sidebar = NULL,
      header = NULL,
      card(
        header = FALSE,
        shiny::h2("loading spinner"),
        spinner(type = "rect", size = "s"),
        spinner(type = "rect", color = "primary"),
        spinner(type = "grow", color = "secondary"),
        spinner(type = "ring", color = "success"),
        spinner(type = "rect", color = "warning"),
        spinner(type = "square", color = "danger"),
        spinner(type = "rect", color = "info")
      )
    ),
    server = function(input, output) {
    }
  )
}
# }

Run the code above in your browser using DataLab