| updateTextInputIcon {shinyWidgets} | R Documentation |
Change the value of a text input icon on the client
updateTextInputIcon( session, inputId, label = NULL, value = NULL, placeholder = 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. |
placeholder |
The placeholder to set for the input object. |
No value.
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
textInputIcon(
inputId = "ex1",
label = "With an icon",
icon = icon("user-circle-o")
),
actionButton("update", "Random value")
)
server <- function(input, output, session) {
observeEvent(input$update, {
updateTextInputIcon(
session = session,
inputId = "ex1",
value = paste(sample(letters, 8), collapse = "")
)
})
}
if (interactive())
shinyApp(ui, server)