Learn R Programming

shinyBS (version 0.10)

bsProgressBar: Twitter Bootstrap Progress Bars

Description

Functions to add and update Twitter Bootstrap Progress Bars in shiny.

Usage

bsProgressBar(inputId, value = 0, visible = TRUE, color, 
              striped = FALSE, animate = FALSE)
updateProgressBar(session, inputId, value=NULL, visible=NULL, 
                  color=NULL, striped=NULL, animate=NULL)

Arguments

session
The session object passed to function given to shinyServer
inputId
Input variable to assign the control's value to
value
The current completion value between 0 and 100.
visible
Should the progress bar be visible (logical).
color
Following Twitter Bootstrap's style scheme, one of standard, warning, danger, info, or success. standard by default.
striped
Should the progress bar be striped (logical).
animate
Should the progress bar be animated (logical).

Details

Progress bars should be initialized with bsProgress in the ui.R script. They can then be updated using updateProgressBar from server.R. When using updateProgressBar only specify those arguments that you want to change. If you call updateProgressBar(value = 25) then only the value will be updated and the other options will remain unchanged.

References

http://getbootstrap.com/2.3.2/components.html{Progress Bars for Twitter Bootstrap 2.3.2}

Examples

Run this code
## Create a striped, green progress bar.
  ## In ui.R
  bsProgressBar("pb1", visible=FALSE, color="success", striped=TRUE)
  
  ## Update previous progress bar 'pb1' to be 25% filled and animated,
  ## In server.R
  updateProgressBar("pb1", value=25, animate=TRUE)

Run the code above in your browser using DataLab