if (interactive()) {
shiny::shinyApp(
ui = shiny::fluidPage(
useShinyjs(), # Set up shinyjs
shiny::actionButton("btn", "Click me"),
hidden(
shiny::p(id = "element", "I was born invisible")
)
),
server = function(input, output, session) {
shiny::observe({
if (input$btn == 0) {
return(NULL)
}
show("element")
})
}
)
}Run the code above in your browser using DataLab