Description Usage Arguments Examples
Update tabler_switch on the client
1 | update_tabler_switch(session, inputId, label = NULL, value = NULL)
|
session |
The |
inputId |
The id of the input object. |
label |
The label to set for the input object. |
value |
Initial value ( |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | if (interactive()) {
library(shiny)
ui <- tabler_page(
tabler_body(
tabler_row(
tabler_button("update", "Go!", width = "25%", class = "mr-2"),
tabler_switch("toggle", "Switch", value = TRUE, width = "25%")
)
)
)
server <- function(input, output, session) {
observe(print(input$toggle))
observeEvent(input$update, {
update_tabler_switch(
session,
"toggle",
value = !input$toggle
)
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.