I can remove outputText("text")
by just using shinyjs::hide("text")
Is it possible to remove a helpText()
from panel in shiny? for example:
helpText("Changes to the table will be automatically saved to the source file")
Greetings !!
Here is the reproducible sample code, hope this helps you.
Regards,
Abhinav Agrawal
library(shiny)
library(shinyjs)
ui <- shinyUI(fluidPage(
useShinyjs(),
titlePanel("Demo - hide or show elements in R Shiny"),
tags$div(id="txt", helpText("This is a help text. You can hide me")),
# OR
# tags$div(id="txt", "This is a help text. You can hide me"),
actionButton(inputId = "showh", label = "Show me"),
actionButton(inputId = "hideh", label = "Hide me"),
hr(),
sliderInput(inputId = "slider", label = "Slider", min = 0, max = 10, value = 5),
actionButton(inputId = "shows", label = "Show Slider"),
actionButton(inputId = "hides", label = "Hide Slider")
))
server <- shinyUI(function(input, output, session){
observeEvent(input$shows,
show("slider"))
observeEvent(input$hides,
hide("slider"))
observeEvent(input$showh,
show("txt"))
observeEvent(input$hideh,
hide("txt"))
})
shinyApp(ui, server)
Thanks very much for your reply.