Update a number input from the server
Usage
update_shad_number_input(
id,
value = NULL,
min = NULL,
max = NULL,
step = NULL,
disabled = NULL,
session = shiny::getDefaultReactiveDomain()
)See also
Other shadshiny flow:
shad_dropzone(),
shad_number_input(),
shad_rating(),
shad_step(),
shad_stepper(),
shad_tree(),
shad_tree_item(),
update_shad_rating(),
update_shad_stepper(),
update_shad_tree()
Examples
if (interactive()) {
ui <- page_shad(
shad_number_input("qty", "Quantity", value = 1, min = 1, max = 10),
shad_switch("bulk", "Bulk order")
)
server <- function(input, output, session) {
shiny::observeEvent(input$bulk, {
if (isTRUE(input$bulk)) {
update_shad_number_input("qty", value = 10, max = 100, step = 10)
} else {
update_shad_number_input("qty", value = 1, max = 10, step = 1)
}
})
}
shiny::shinyApp(ui, server)
}