progressbar: Progress Bar

Description Usage Arguments Value Examples

View source: R/progressbar.R

Description

Create a new progress bar in your shiny app. This progress bar was designed for apps that many pages that are viewed in a given order. This may be useful apps that have a series of instructions screens or that are designed for qualitative data collection (i.e., survey data). For example, let's say that an app has 10 instruction pages. The user is instructed to read through all pages and use the navigation buttons (next and back) to move between pages. The progress bar can be useful in this situation as it visually shows how many pages are left.

Usage

1
progressbar(start = 0, min = 0, max = 7)

Arguments

start

the starting point for the progress bar

min

the minimum value of the progress bar

max

the maximum value of the progress bar

Value

Create a new progress bar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
if (interactive()) {
library(shiny)

mybar <- iceComponents::progressbar(max = 10)

ui <- tagList(
    iceComponents::use_accessibleshiny(),
    tags$main(
        style = "display: block; height: 50vh; margin-top: 50px",
        actionButton("increaseBar", "Next"),
        actionButton("descreaseBar", "Previous")
    ),
    mybar$bar(
        id = "bar1",
        fixed = TRUE
    )
)

server <- function(input, output) {
    mybar$listen()

    observeEvent(input$increaseBar, {
        mybar$increase()
    })

    observeEvent(input$descreaseBar, {
        mybar$decrease()
    })
}

shinyApp(ui, server)
}

InControlofEffects/iceComponents documentation built on April 1, 2021, 5:51 a.m.