Description Usage Arguments See Also Examples
An info box displays a large icon on the left side, and a title, value (usually a number), and an optional smaller subtitle on the right side. Info boxes are meant to be placed in the main body of a dashboard.
1 2 3 |
title |
Title text. |
value |
The value to display in the box. Usually a number or short text. |
subtitle |
Subtitle text (optional). |
icon |
An icon tag, created by |
color |
A color for the box. |
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 valueBox width of 4 occupies 1/3 of that width. For column-based
layouts, use |
href |
An optional URL to link to. |
fill |
If |
fdBox
for usage examples.
Other boxes: fdBox
, fdValueBox
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 | library(flightdeck)
library(htmltools)
# Example 1
if (interactive()){
tagList(
fdInfoBox('Adjusted R-squared', '86.9%',
color = 'blue', icon = fdIcon('chart-line', lib = 'entypo')),
fdInfoBox('F-Statistic', 13.93, 'on 10 and 21 degrees of freedom',
color = 'green', icon = fdIcon('star', lib = 'entypo')),
fdInfoBox('Residual Standard Error', 2.65, 'on 21 degrees of freedom',
color = 'purple', icon = fdIcon('flash', lib = 'entypo'))
) %>%
fdPreview(wrapBox = F)
}
# Example 2: Interactive help embedded in stat box.
# The message supports markdown.
msg <- "The adjusted R-squared measures the explanatory power of regression models."
adjRsquared <- span("Adjusted R-squared",
fdIcon('info-circled', lib = 'entypo') %>%
fdModal(msg, title = 'Adjusted R-Squared')
)
if (interactive()){
tagList(
fdInfoBox(adjRsquared, '86.9%',
color = 'blue', icon = fdIcon('chart-line', lib = 'entypo')),
fdInfoBox('F-Statistic', 13.93, 'on 10 and 21 degrees of freedom',
color = 'green', icon = fdIcon('star', lib = 'entypo')),
fdInfoBox('Residual Standard Error', 2.65, 'on 21 degrees of freedom',
color = 'purple', icon = fdIcon('flash', lib = 'entypo'))
) %>%
fdPreview(wrapBox = F)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.