| updateNumericInputIcon {shinyWidgets} | R Documentation |
Change the value of a numeric input icon on the client
updateNumericInputIcon( session, inputId, label = NULL, value = NULL, min = NULL, max = NULL, step = NULL )
session |
The |
inputId |
The id of the input object. |
label |
The label to set for the input object. |
value |
The value to set for the input object. |
min |
Minimum value. |
max |
Maximum value. |
step |
Step size. |
No value.
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
numericInputIcon(
inputId = "ex1",
label = "With an icon",
value = 10,
icon = icon("percent")
),
actionButton("update", "Random value")
)
server <- function(input, output, session) {
observeEvent(input$update, {
updateNumericInputIcon(
session = session,
inputId = "ex1",
value = sample.int(100, 1)
)
})
}
if (interactive())
shinyApp(ui, server)