Last few tabs did not show up on the app UI because of laptop screen size

I have a Shiny app with many tabs. If I make the app window small enough, all of them will show up. But if I maximize the window, the last few tabs are not visible without any way to get to them.
What setting will make these tabs wrap around to the next row? Thank you!

Small app window

Maximize app window


library(shiny)
library(leaflet)

ui <- fluidPage(

  titlePanel(title = "App with tabs"),

  sidebarLayout(
    sidebarPanel(
      style = "position:fixed; width:500px;",
      leafletOutput("mymap", height = 500),
      p(),
      actionButton("recalc", "New points")
    ),

    mainPanel(
      tags$head(
        tags$style(
          "#inTabset {
        position: fixed;
        width: 100%;
        background-color: white;
        top: 0;
        }",
        ".tab-content  {
        margin-top: 30px;
      }"
        )
      ),

      tabsetPanel(type = "tabs",
                  id   = "inTabset",
                  tabPanel("Information"),
                  tabPanel("Data"),
                  tabPanel("Explanation"),
                  tabPanel("Long tab name 1"),
                  tabPanel("Long tab name 2"),
                  tabPanel("Long tab name 3"),
                  tabPanel("Long tab name 4"),
                  tabPanel("Long tab name 5"),
                  tabPanel("Long tab name 6"),
                  tabPanel("Long tab name 7"),
                  tabPanel("Long tab name 8")
      )
    )
  )
)

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

  points <- eventReactive(input$recalc, {
    cbind(rnorm(40) * 2 + 13, rnorm(40) + 48)
  }, ignoreNULL = FALSE)

  output$mymap <- renderLeaflet({
    leaflet() %>%
      addProviderTiles(providers$Stamen.TonerLite,
                       options = providerTileOptions(noWrap = TRUE)
      ) %>%
      addMarkers(data = points())
  })

}

shinyApp(ui, server)

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.