A reusable Shiny module for displaying statistics with an icon, numeric value, and label. Commonly used in dashboards for showing counts, totals, or metrics.
Value
- statsBoxUI
Shiny UI tagList with styled stats box markup
- statsBoxServer
Module server (called for side effects)
Styling
The module includes self-contained CSS with:
White background with subtle shadow
Circular blue icon container
Large bold number display
Gray label text below
Responsive flex layout (4 boxes per row on wide screens)
See also
Other ui-components:
button_factory(),
create_waiter(),
status_badge(),
status_class(),
ui-helpers,
waiter-reexports,
waiter-screens
Examples
if (FALSE) { # \dontrun{
# In UI
statsBoxUI("artwork_count", icon = "palette")
# In server
statsBoxServer(
"artwork_count",
r_stat_value = reactive(nrow(artworks_data())),
stat_label = "Total Artworks"
)
} # }
