f7Checkbox creates a checkbox input.
updateF7Checkbox
changes the value of a checkbox input on the client.
Usage
f7Checkbox(inputId, label, value = FALSE)
updateF7Checkbox(
inputId,
label = NULL,
value = NULL,
session = shiny::getDefaultReactiveDomain()
)
Examples
library(shiny)
library(shinyMobile)
app <- shinyApp(
ui = f7Page(
f7SingleLayout(
navbar = f7Navbar(title = "updateF7Checkbox"),
f7Block(f7Button("update", "Toggle checkbox")),
f7Checkbox(
inputId = "checkbox",
label = "Checkbox",
value = FALSE
)
)
), server = function(input, output, session) {
observeEvent(input$update, {
updateF7Checkbox("checkbox", value = !input$checkbox)
})
}
)
if (interactive() || identical(Sys.getenv("TESTTHAT"), "true")) app