I want to develop an app with a layout similar to Radiant in the Shiny gallery (https://shiny.rstudio.com/gallery/radiant.html). In that app, the sidebarPanel changes for each tabPanel that exists in the mainPanel. How is that accomplished? This picture shows my layout, where I want the sidebarPanel (empty now) to change based on which tab (Metadata, Raw Data, QC Data) is chosen by the user. Does someone either know how to do this or can you point me to where the ui code in the Radiant app is located?
EDIT: After receiving the answer below, I edited the code to look like this, rather than put the sidebar in a new function. It is not working yet, however. Shouldn't it? What's still wrong?
ui <- navbarPage(title = "SD Mesonet Quality Control", id = "navbarPage",
tabPanel(title = 'Data',
sidebarLayout(
sidebarPanel(
conditionalPanel(condition="input.tabselected == 1",
actionButton('bt','button Tab 1')
),
conditionalPanel(condition="input.tabselected == 2",
selectInput('select','choice',choices=c("A","B"))
)
),
mainPanel(
tabsetPanel(type = "tabs", id = "tabselected",
tabPanel("Instrumentation", value = 1, plotOutput("plot")),
tabPanel("Metadata", value = 2, plotOutput("plot"))
)
)
),
)
)
server <- function(input,output){
}
shinyApp(ui,server)