Files
shiny/man/removeTab.Rd
Barbara Borges Ribeiro b94efe81e4 finish insertTab
2017-08-04 15:09:00 +01:00

55 lines
1.5 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/insert-ui.R
\name{removeTab}
\alias{removeTab}
\title{Dynamically remove a tabPanel}
\usage{
removeTab(tabsetPanelId, target, immediate = FALSE,
session = getDefaultReactiveDomain())
}
\arguments{
\item{tabsetPanelId}{The \code{id} of the \code{tabsetPanel()} from which
\code{target} will be removed.}
\item{target}{The \code{value} of the \code{tabPanel()} to be removed.}
\item{immediate}{Whether \code{tab} should be immediately removed from
the app when you call \code{removeTab}, or whether Shiny should wait until
all outputs have been updated and all observers have been run (default).}
\item{session}{The shiny session within which to call \code{removeTab}.}
}
\description{
Dynamically remove a \code{tabPanel()} from an existing \code{tabsetPanel}.
}
\examples{
## Only run this example in interactive R sessions
if (interactive()) {
ui <- fluidPage(
sidebarLayout(
sidebarPanel(actionButton("remove", "Remove tab")),
mainPanel(
tabsetPanel(id = "tabs",
tabPanel("Hello", "This is the hello tab"),
tabPanel("Foo", "This is the foo tab"),
tabPanel("Bar", "This is the bar tab")
)
)
)
)
server <- function(input, output, session) {
observeEvent(input$remove, {
removeTab(tabsetPanelId = "tabs",
target = "Bar"
)
})
}
shinyApp(ui, server)
}
}
\seealso{
\code{\link{insertTab}}, \code{\link{showTab}},
\code{\link{hideTab}}
}