0

I am trying to remove the entire wellpanel using removeUI() in my shiny app. I'm not sure what to be used as a selector. Can anyone help me in this regard?

Usha
  • 17
  • 6
  • Can you work a bit on your question so we can help you? What have you tried? See https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Aurèle Jan 18 '18 at 10:13

1 Answers1

2

If you create the UI and then open up a Shiny app in a browser and use inspect element you can see that wellPanel has a class = well

Inspect element

So one possibility is to specify the class a selector like .class_name. In your case it is: selector = ".well".

Here is a minimal Shiny app that removes a single wellPanel from a page using class

library(shiny)

ui <- fluidPage(
  wellPanel(
    "This is going to be removed",
    plotOutput("plot")
  ),

  actionButton("btn", "Remove wellPanel")
)

server <- function(input, output, session) {
  output$plot <- renderPlot(plot(iris))

  observeEvent(input$btn, {
    removeUI(selector = ".well")
  })
}

shinyApp(ui, server)
GyD
  • 3,902
  • 2
  • 18
  • 28