I would like to build an application and some of the tabs will be hidden to the user until he types the right password. I know how to do this with shinyjs::hideTab
How about this
library(shiny);library(shinyjs)
ui <- fluidPage(useShinyjs(),
navbarPage("hello", id="hello",
tabPanel("home", br(), h3("this is home"),passwordInput("pass", "enter 'password' to see the tabs: "),actionButton("enter", "enter")),
tabPanel("tab2",uiOutput("tab2Content")),
tabPanel("tab3 with a lot of stuff in it", uiOutput("tab3Content"))))
server <- function(input, output, session) {
output$tab2Content <- renderUI({
req(input$pass == "password")
tagList(
br(),
h4("this is tab2")
)
})
output$tab3Content <- renderUI({
req(input$pass == "password")
tagList(
br(),
h4("this is tab3")
)
})}
shinyApp(ui, server)
hope this helps!