badge | R Documentation |
Small highlighted content which scales to its parent's size. A badge may
be dynamically updated with replaceContent()
, in which case be sure to
pass an id
argument as part of ...
.
badge(...)
... |
Named arguments passed as HTML attributes to the parent element or tag elements passed as children to the parent element. |
Badges may be combined with other elements. They can be placed inside buttons.
buttonInput( .style %>% background("primary"), id = NULL, label = "Counter", badge(2) %>% background("light") )
You can also pair badges with list groups.
listGroupItem <- function(...) { div(...) %>% width(100) %>% display("flex") %>% flex(justify = "between", align = "center") } listGroupInput( .style %>% width(50) %>% background("secondary"), id = NULL, choices = list( listGroupItem("Mail", badge(tags$i(class = "fas fa-envelope fa-lg"))), listGroupItem("Research", badge(tags$i(class = "fas fa-vial fa-lg"))) ) )
Other components:
alert()
,
blockquote()
,
card()
,
collapsePane()
,
d1()
,
dropdown()
,
img()
,
jumbotron()
,
modal()
,
navContent()
,
popover()
,
pre()
,
toast()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.