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)