How to update button labels in R Shiny? -


the r shiny website has great example of how update labels , values of variety of input types based on user input. however, couldn't find buttons. specifically, how update label button based on user input?

you can dynamically create button so, updating labels @ same time:

library(shiny)  ui =(pagewithsidebar(   headerpanel("test shiny app"),   sidebarpanel(     textinput("sample_text", "test", value = "0"),     #display dynamic ui     uioutput("my_button")),   mainpanel() ))  server = function(input, output, session){   #make dynamic button   output$my_button <- renderui({     actionbutton("action", label = input$sample_text)   }) } runapp(list(ui = ui, server = server)) 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -