A value box displays a value (usually a number) in large text, with a smaller caption beneath, and a large icon on the right side.
Arguments
- value
The value to display in the box. Usually a number or short text.
- caption
The caption to display beneath the value.
- icon
An icon for the box (e.g. "fa-comments")
- color
Background color for the box. This can be one of the built-in background colors ("primary", "info", "success", "warning", "danger") or any valid CSS color value.
- href
An optional URL to link to. Note that this can be an anchor of another dashboard page (e.g. "#details").
Details
See the flexdashboard website for additional documentation: <https://pkgs.rstudio.com/flexdashboard/articles/using.html#value-boxes-1>
Examples
library(flexdashboard)
valueBox(42, caption = "Errors", icon="fa-thumbs-down")
#> <span class="value-output" data-caption="Errors" data-icon="fa-thumbs-down" data-color-accent="primary">42</span>
valueBox(107, caption = "Trials", icon="fa-tag")
#> <span class="value-output" data-caption="Trials" data-icon="fa-tag" data-color-accent="primary">107</span>
valueBox(247, caption = "Connections", icon="fa-random")
#> <span class="value-output" data-caption="Connections" data-icon="fa-random" data-color-accent="primary">247</span>
