progressBar: AdminLTE2 vertical progress bar

View source: R/useful-items.R

progressBarR Documentation

AdminLTE2 vertical progress bar

Description

This creates a vertical progress bar.

Usage

progressBar(
  value,
  min = 0,
  max = 100,
  vertical = FALSE,
  striped = FALSE,
  animated = FALSE,
  status = "primary",
  size = NULL,
  label = NULL
)

Arguments

value

Progress bar value. Must be between min and max.

min

Progress bar minimum value (0 by default).

max

Progress bar maximum value (100 by default).

vertical

Progress vertical layout. Default to FALSE

striped

Whether the progress is striped or not. FALSE by default.

animated

Whether the progress is active or not. FALSE by default. Works only if striped is TRUE.

status

Progress bar status. "primary" by default or "warning", "info", "danger" or "success". Valid statuses are defined as follows:

  • primary: \Sexpr[results=rd, stage=render]{shinydashboardPlus:::rd_color_tag("#3c8dbc")}

  • success: \Sexpr[results=rd, stage=render]{shinydashboardPlus:::rd_color_tag("#00a65a")}

  • info: \Sexpr[results=rd, stage=render]{shinydashboardPlus:::rd_color_tag("#00c0ef")}

  • warning: \Sexpr[results=rd, stage=render]{shinydashboardPlus:::rd_color_tag("#f39c12")}

  • danger: \Sexpr[results=rd, stage=render]{shinydashboardPlus:::rd_color_tag("#f56954")}

size

Progress bar size. NULL by default: "sm", "xs" or "xxs" also available.

label

Progress label. NULL by default.

Author(s)

David Granjon, dgranjon@ymail.com

Examples

if (interactive()) {
  library(shiny)
  library(shinydashboard)
  library(shinydashboardPlus)

  shinyApp(
    ui = dashboardPage(
      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        box(
          title = "Horizontal",
          progressBar(
            value = 10,
            striped = TRUE,
            animated = TRUE,
            label = "10%"
          ),
          progressBar(
            value = 50,
            status = "warning",
            size = "xs"
          ),
          progressBar(
            value = 20,
            status = "danger",
            size = "sm"
          )
        ),
        box(
          title = "Vertical",
          progressBar(
            value = 10,
            striped = TRUE,
            animated = TRUE,
            vertical = TRUE
          ),
          progressBar(
            value = 50,
            status = "warning",
            size = "xs",
            vertical = TRUE
          ),
          progressBar(
            value = 20,
            status = "danger",
            size = "sm",
            vertical = TRUE
          )
        )
      ),
      title = "Progress bars"
    ),
    server = function(input, output) { }
  )
}

DivadNojnarg/shinydashboardPlus documentation built on Aug. 3, 2024, 2:42 a.m.