Description Usage Arguments Example application See Also Examples
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 ....
1 |
... |
Named arguments passed as HTML attributes to the parent element or tag elements passed as children to the parent element. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ui <- container(
buttonInput(
id = "clicker",
label = list(
"Clicks",
badge(id = "counter") %>%
margin(left = 2) %>%
background("teal")
)
)
)
server <- function(input, output) {
observe({
clicks <- if (is.null(input$clicker)) 0 else input$clicker
replaceContent("counter", clicks)
})
}
shinyApp(ui, server)
|
Other components:
alert(),
blockquote(),
card(),
collapsePane(),
d1(),
dropdown(),
img(),
jumbotron(),
modal(),
navContent(),
popover(),
pre(),
toast()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.