counter_button | R Documentation |
Creates a counter button whose value increments by one each time it is pressed.
counter_button(
input_id,
label = "",
icon = NULL,
value = 0,
color = "",
size = "",
big_mark = " "
)
input_id |
The |
label |
the content of the item to display |
icon |
an optional |
value |
initial rating value (integer) |
color |
character with semantic color |
size |
character with size of the button, eg. "medium", "big" |
big_mark |
big numbers separator |
counter button object
if (interactive()) {
library(shiny)
library(shiny.semantic)
ui <-semanticPage(
counter_button("counter", "My Counter Button",
icon = icon("world"),
size = "big", color = "purple")
)
server <- function(input, output) {
observeEvent(input$counter,{
print(input$counter)
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.