removeOutput {shiny.destroy} | R Documentation |
Remove Output from Shiny Session
Description
The removal of the named output in a shiny session.
Usage
removeOutput(
id,
selector = paste0("#", id),
session = getDefaultReactiveDomain()
)
Arguments
id |
Output value name |
selector |
The HTML selector to remove the UI for. By default it is the tag where the ID matches the output, but might need to be adjusted for different inputs. |
session |
The Shiny session to remove the output from |
Value
An invisible 'TRUE' value confirming that the output has been removed.
Examples
library(shiny)
library(shiny.destroy)
ui <- fluidPage(
numericInput("number", "Select number:", 5, 1, 10),
p("Selected number:", textOutput("number_out", inline = TRUE)),
actionButton("delete", "Remove output")
)
server <- function(input, output, session) {
output$number_out <- renderText(input$number)
observeEvent(
input$delete,
removeOutput("number_out")
)
}
shinyApp(ui, server)
[Package shiny.destroy version 0.1.0 Index]