progressOutput: Progress bar in shiny dashboard

View source: R/progress.R

progressOutputR Documentation

Progress bar in shiny dashboard

Description

For detailed usage, see demo application by running render().

Usage

progressOutput(
  outputId,
  ...,
  description = "Initializing",
  width = "100%",
  class = "bg-primary",
  value = 0,
  size = c("md", "sm", "xs")
)

renderProgress(expr, env = parent.frame(), quoted = FALSE, outputArgs = list())

Arguments

outputId

the element id of the progress

...

extra elements on the top of the progress bar

description

descriptive message below the progress bar

width

width of the progress

class

progress class, default is "bg-primary"

value

initial value, ranging from 0 to 100; default is 0

size

size of the progress bar; choices are "md", "sm", "xs"

expr

R expression that should return a named list of value and description

env

where to evaluate expr

quoted

whether expr is quoted

outputArgs

a list of other parameters in progressOutput

Value

progressOutput returns 'HTML' tags containing progress bars that can be rendered later via shiny_progress or renderProgress. renderProgress returns shiny render functions internally.

Examples


library(shiny)
library(shidashi)
progressOutput("sales_report_prog1",
               description = "6 days left!",
               "Add Products to Cart",
               span(class="float-right", "123/150"),
               value = 123/150 * 100)

# server function
server <- function(input, output, session, ...){
  output$sales_report_prog1 <- renderProgress({
    return(list(
      value = 140 / 150 * 100,
      description = "5 days left!"
    ))
  })
}


shidashi documentation built on June 21, 2022, 5:05 p.m.