ui.value_box
ui.value_box(
title,
value,*args,
=None,
showcase='left center',
showcase_layout=False,
full_screen=None,
theme=None,
height=None,
max_height=None,
min_height=True,
fill=None,
class_id=None,
**kwargs,
)
Value box
An opinionated (card
-powered) box, designed for displaying a value
and title
. Optionally, a showcase
can provide context for what the value
represents (for example, it could hold an icon, or even a output_plot
).
Parameters
title : TagChild
-
A string, number, or
Tag
child to display as the title or value of the value box. Thetitle
appears above thevalue
. *args : TagChild | TagAttrs = ()
-
Unnamed arguments may be any
Tag
children to display belowvalue
. Named arguments are passed tocard
as element attributes. showcase : Optional[TagChild] = None
-
A
Tag
child to showcase (e.g., an icon, aoutput_plot
, etc). showcase_layout :
SHOWCASE_LAYOUTS_STR
|ShowcaseLayout
= 'left center'-
One of
"left center"
(default),"top right"
or"bottom"
. Alternatively, you can customize the showcase layout options with theshowcase_left_center
,showcase_top_right
, orshowcase_bottom
functions. Use the options functions when you want to control the height or width of the showcase area. theme : Optional[str |
ValueBoxTheme
] = None-
The name of a theme (e.g.
"primary"
,"danger"
,"purple"
,"bg-green"
,"text-red"
) for the value box, or a theme constructed withvalue_box_theme
. The theme names provide a convenient way to use your app’s Bootstrap theme colors as the foreground or background colors of the value box. For more control, you can create your own theme withvalue_box_theme
where you can pass foreground and background colors directly. Bootstrap supported color themes:"blue"
,"purple"
,"pink"
,"red"
,"orange"
,"yellow"
,"green"
,"teal"
, and"cyan"
. These colors can be used withbg-NAME
,text-NAME
, andbg-gradient-NAME1-NAME2
to change the background, foreground, or use a background gradient respectively. If atheme
string does not start withtext-
orbg-
, it will be auto prefixed withbg-
. full_screen : bool = False
-
If
True
, an icon will appear when hovering over the card body. Clicking the icon expands the card to fit viewport size. height : Optional[CssUnit] = None
-
Any valid CSS unit (e.g.,
height="200px"
). Doesn’t apply when a value box is madefull_screen
. fill : bool = True
-
Whether to allow the value box to grow/shrink to fit a fillable container with an opinionated height (e.g.,
page_fillable
). class_ : Optional[str] = None
-
Utility classes for customizing the appearance of the summary card. Use
bg-*
andtext-*
classes (e.g,"bg-danger"
and"text-light"
) to customize the background/foreground colors. id : Optional[str] = None
-
Provide a unique identifier for the :func:
~shiny.ui.value_box()
to report its state to Shiny. For example, usingid="my_value_box"
, you can observe the value box’s full screen state withinput.my_value_box()["full_screen"]
. ****kwargs** : TagAttrValue = {}
-
Additional attributes to pass to
card
.