bs4Dash (version 0.5.0)

renderbs4ValueBox: Create a value box (server side)

Description

This is the server-side function for creating a dynamic bs4ValueBox.

Usage

renderbs4ValueBox(expr, env = parent.frame(), quoted = FALSE)

renderbs4InfoBox(expr, env = parent.frame(), quoted = FALSE)

renderValueBox(expr, env = parent.frame(), quoted = FALSE)

Arguments

expr

An expression that returns a Shiny tag object, HTML(), or a list of such objects.

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

See Also

bs4ValueBoxOutput for the corresponding UI-side function.

Examples

Run this code
# NOT RUN {
if(interactive()){
 library(shiny)
 library(bs4Dash)
 
 shiny::shinyApp(
   ui = bs4DashPage(
     navbar = bs4DashNavbar(),
     sidebar = bs4DashSidebar(),
     controlbar = bs4DashControlbar(),
     footer = bs4DashFooter(),
     title = "test",
     body = bs4DashBody(
      fluidRow(
       bs4ValueBoxOutput("vbox"),
       bs4InfoBoxOutput("ibox")
      )
     )
   ),
   server = function(input, output) {
   
     output$vbox <- renderbs4ValueBox({
      bs4ValueBox(
        value = 150,
        subtitle = "New orders",
        status = "primary",
        icon = "shopping-cart",
        href = "#"
       )
    })
    
    output$ibox <- renderbs4InfoBox({
      bs4InfoBox(
       title = "Comments",
       gradientColor = "success",
       value = 41410,
       icon = "comments"
       )
    })
    
   }
 )
}

# }

Run the code above in your browser using DataLab