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.
fdInfoBox(title, value = NULL, subtitle = NULL, icon = fdIcon("bar-chart"), color = "aqua", width = 4, href = NULL, fill = FALSE)
icon
.NULL
for the width; the width is set by the column that
contains the box.FALSE
(the default), use a white background for the
content, and the color
argument for the background of the icon. If
TRUE
, use the color
argument for the background of the
content; the icon will use the same color with a slightly darkened
background.fdBox
for usage examples.
Other boxes: fdBox
, fdValueBox
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) }