Separate the title from the tabPanels in navbarPage

Is it possible to put all tabPanels in a row below the title of a navbarPage? In other words, I would like to keep the appearance of the navbarPage but on two rows: the title on the first one, and the tabPanels on the second. This would allow to "isolate" the title by keeping it on a single row.

I suppose it requires CSS and maybe it is very basic but I can't figure out how to do it.

library(shiny)

ui <- navbarPage(
  title = "some title",
  tabPanel("first tab"),
  tabPanel("second tab")
)

server <- function(input, output, session) {}

shinyApp(ui, server)

Note that this doesn't have to be a navbarPage. Any UI that could do that is accepted but it has to have the appearance of a navbarPage (no space between the rows, etc.). Hope this is clear enough.

Also asked on SO

Answer on StackOverflow (centers the title as well):

library(shiny)

ui <- navbarPage(
  title = "some title",
  tabPanel("first tab"),
  tabPanel("second tab"),
  tags$style(HTML(".navbar-header { width:100% }
                   .navbar-brand { width: 100%; text-align: center }")) # center text
)

server <- function(input, output, session) {}

shinyApp(ui, server)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.