bs4ValueBox: Boostrap 4 value box

Description Usage Arguments Author(s) See Also Examples

View source: R/cards.R

Description

A beautiful AdminLTE3 value box.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
bs4ValueBox(
  value,
  subtitle,
  icon = NULL,
  elevation = NULL,
  status = NULL,
  width = 3,
  footer = NULL,
  href = NULL
)

valueBox(
  value,
  subtitle,
  icon = NULL,
  elevation = NULL,
  status = NULL,
  width = 3,
  footer = NULL,
  href = NULL
)

Arguments

value

The value to display in the box. Usually a number or short text.

subtitle

Subtitle text.

icon

An icon tag, created by icon.

elevation

Value box elevation.

status

A color for the box. "primary", "info", "success", "warning", "danger" or NULL.

width

The width of the box, using the Bootstrap grid system. This is used for row-based layouts. The overall width of a region is 12, so the default width of 4 occupies 1/3 of that width. For column-based layouts, use NULL for the width; the width is set by the column that contains the box.

footer

Optional html content for the footer of the box.

href

An optional URL to link to in the footer. Should both 'footer' and this parameter be set, 'footer' will take precedence.

Author(s)

David Granjon, dgranjon@ymail.com

See Also

Other cards: bs4Card(), bs4InfoBox(), bs4TabCard()

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
33
34
35
36
37
38
39
if(interactive()){
 library(shiny)
 library(bs4Dash)
 
 shiny::shinyApp(
   ui = bs4DashPage(
     navbar = bs4DashNavbar(),
     sidebar = bs4DashSidebar(),
     controlbar = bs4DashControlbar(),
     footer = bs4DashFooter(),
     title = "test",
     body = bs4DashBody(
      fluidRow(
       bs4ValueBox(
        value = 150,
        subtitle = "New orders",
        status = "primary",
        icon = "shopping-cart",
        href = "#"
       ),
       bs4ValueBox(
        value = "53%",
        subtitle = "New orders",
        status = "danger",
        icon = "cogs",
        footer = shiny::div("Hello World")
       ),
       bs4ValueBox(
        value = "44",
        subtitle = "User Registrations",
        status = "warning",
        icon = "sliders"
       )
      )
     )
   ),
   server = function(input, output) {}
 )
}

bs4Dash documentation built on Dec. 1, 2019, 1:28 a.m.