Skip to contents

Value Box

Usage

value_box_es_app(...)

value_box_es_ui(id, ...)

value_box_es_server(
  id,
  title,
  value,
  showcase = shiny::reactive(NULL),
  theme_color = shiny::reactive(NULL)
)

value_box_es_ui_sdb(id, width = 12)

value_box_es_server_sdb(id, title, value, showcase, theme_color)

value_box_es_ui_bslib(id, min_height = "200px", ...)

value_box_es_server_bslib(id, title, value, showcase, theme_color)

Arguments

...

Arguments passed on to shiny::shinyApp, value_box_es_ui_sdb, value_box_es_ui_bslib, shinydashboard::valueBoxOutput

ui

The UI definition of the app (for example, a call to fluidPage() with nested controls).

If bookmarking is enabled (see enableBookmarking), this must be a single argument function that returns the UI definition.

server

A function with three parameters: input, output, and session. The function is called once for each session ensuring that each app is independent.

onStart

A function that will be called before the app is actually run. This is only needed for shinyAppObj, since in the shinyAppDir case, a global.R file can be used for this purpose.

options

Named options that should be passed to the runApp call (these can be any of the following: "port", "launch.browser", "host", "quiet", "display.mode" and "test.mode"). You can also specify width and height parameters which provide a hint to the embedding environment about the ideal height/width for the app.

uiPattern

A regular expression that will be applied to each GET request to determine whether the ui should be used to handle the request. Note that the entire request path must match the regular expression in order for the match to be considered successful.

enableBookmarking

Can be one of "url", "server", or "disable". The default value, NULL, will respect the setting from any previous calls to enableBookmarking(). See enableBookmarking() for more information on bookmarking your app.

outputId

Output variable name.

id

The id string to be namespaced (optional).

title, value

A string, number, or htmltools::tag() child to display as the title or value of the value box. The title appears above the value.

showcase

A htmltools::tag() child to showcase (e.g., a bsicons::bs_icon(), a plotly::plotlyOutput(), etc).

theme_color

A reactive yielding a bootstrap 5 contextual class ("primary", "danger", etc.), which is applied to the value box. If outside of bootstrap 5, contextual classes are translated, as far as possible. Defaults to NULL, in which no special class is applied.

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 NULL for the width; the width is set by the column that contains the box.

min_height

The minimum height of the values box. Can be any valid CSS unit (e.g., min_height="200px").

Functions

  • value_box_es_app(): Test app

  • value_box_es_ui(): Module UI

  • value_box_es_server(): Module Server

  • value_box_es_ui_sdb(): Module UI (shinydashboard)

  • value_box_es_server_sdb(): Module Server (shinydashboard)

  • value_box_es_ui_bslib(): Module UI (bslib)

  • value_box_es_server_bslib(): Module Server (bslib)

Icons

Notice that only objects passable to bslib::value_box() are accepted for the showcase argument, such as bsicons::bs_icon() (recommended). shiny::icon()s are not accepted.

Screenshots from Tests

name: sdb, variant: linux Screenshot name: bslib, variant: linux Screenshot