How to give a name to tabsetpanel in Shiny app


#1

Hi,
I searched on Google, but couldn't find an answer.
It should be obvious, but I couldn't give a name to tabsetpanel in Shiny app.

As an example from the R, I want to give a name to tabsetpanel here:

mainPanel(
tabsetPanel("new name",
tabPanel("Plot", plotOutput("plot")),
tabPanel("Summary", verbatimTextOutput("summary")),
tabPanel("Table", tableOutput("table"))
)
)

Can anyone point out the resource to find this?
Thank you.


#2

Unfortunately, tabsetPanel() doesn't take a name argument. I guess a workaround is to insert a heading tag just before the tabsetPanel(). Here's an example with a sidebar and an overall app title:

library(shiny)

ui <- fluidPage(
  titlePanel("This is the app title"),
  
  sidebarLayout(
    
    sidebarPanel(
      p("This is the sidebar")
    ),
    
    mainPanel(
      
      h3("Tabset Panel Name"),
      tabsetPanel(
        tabPanel("Plot", plotOutput("plot")),
        tabPanel("Summary", verbatimTextOutput("summary")),
        tabPanel("Table", tableOutput("table"))
      )
    )
    
  )
)

server <- function(input, output) {
  
}

shinyApp(ui, server)

Or on narrow viewports:

27


#3

Hi,

thank you so much for your reply.
This will help me a lot.
thank you.

Mustafa