Description Usage Arguments Author(s) See Also Examples
This is the server-side function for creating a dynamic
bs4ValueBox
.
This is the UI-side function for creating a dynamic bs4ValueBox
.
A beautiful AdminLTE3 value box.
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 | renderbs4ValueBox(expr, env = parent.frame(), quoted = FALSE)
bs4ValueBoxOutput(outputId, width = 4)
bs4ValueBox(
value,
subtitle,
icon = NULL,
color = NULL,
width = 3,
href = NULL,
footer = NULL,
gradient = FALSE,
elevation = NULL
)
valueBox(
value,
subtitle,
icon = NULL,
color = NULL,
width = 3,
href = NULL,
footer = NULL,
gradient = FALSE,
elevation = NULL
)
valueBoxOutput(outputId, width = 4)
renderValueBox(expr, env = parent.frame(), quoted = FALSE)
|
expr |
An expression that returns a Shiny tag object, |
env |
The environment in which to evaluate |
quoted |
Is |
outputId |
Output variable name. |
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 |
value |
The value to display in the box. Usually a number or short text. |
subtitle |
Subtitle text. |
icon |
An icon tag, created by |
color |
The color of the item. This determines the item's background color. Valid colors are defined as follows:
|
href |
An optional URL to link to in the footer. Should both 'footer' and this parameter be set, 'footer' will take precedence. |
footer |
Optional html content for the footer of the box. |
gradient |
Whether to use gradient style for background color. Default to FALSE. |
elevation |
Value box elevation. |
David Granjon, dgranjon@ymail.com
bs4ValueBoxOutput
for the corresponding UI-side function.
renderbs4ValueBox
for the corresponding server-side
function and examples.
Other cards:
bs4CardLayout()
,
bs4SocialCard()
,
bs4TabCard()
,
bs4UserCard()
,
descriptionBlock()
,
renderbs4InfoBox()
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 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"
)
})
}
)
}
if (interactive()) {
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
sidebar = dashboardSidebar(),
controlbar = dashboardControlbar(),
footer = dashboardFooter(),
title = "test",
body = bs4DashBody(
fluidRow(
valueBox(
value = 150,
subtitle = "New orders",
color = "primary",
icon = icon("shopping-cart")
),
valueBox(
value = "53%",
subtitle = "New orders",
color = "indigo",
icon = icon("cogs"),
footer = div("Hello World")
),
valueBox(
value = "44",
subtitle = "User Registrations",
color = "teal",
icon = icon("sliders")
)
)
)
),
server = function(input, output) {}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.