I have the shiny dashboard plus below with a shiny
widget in the right sidebar. I would like to know how I could display it only when the tabPanel Plot
is selected.
library(shiny)
library(shinydashboardPlus)
shinyApp(
ui = dashboardPagePlus(
header = dashboardHeaderPlus(
enable_rightsidebar = TRUE,
rightSidebarIcon = "gears"
),
sidebar = dashboardSidebar(),
body = dashboardBody(
navbarPage("Navbar!",
tabPanel("Plot"
),
tabPanel("Summary"
))
),
rightsidebar = rightSidebar(
background = "dark",
rightSidebarTabContent(
id = 1,
title = "Tab 1",
icon = "desktop",
active = TRUE,
uiOutput("sl")
)
),
title = "Right Sidebar"
),
server = function(input, output) {
output$sl<-renderUI({
sliderInput(
"obs",
"Number of observations:",
min = 0, max = 1000, value = 500
)
})
}
)