Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab panel functions don't produce Bootstrap 4 compatible markup #3320

Closed
cpsievert opened this issue Mar 6, 2021 · 0 comments · Fixed by #3315
Closed

Tab panel functions don't produce Bootstrap 4 compatible markup #3320

cpsievert opened this issue Mar 6, 2021 · 0 comments · Fixed by #3315
Milestone

Comments

@cpsievert
Copy link
Collaborator

cpsievert commented Mar 6, 2021

And as a result, tabsetPanel() et al. don't work well with Bootstrap 4 "plugin" frameworks like Bootswatch 4 or AdminLTE 3, which make strong assumptions about nav (as well as other) markup. In addition to working better with these frameworks, if tabPanel() markup produced the right markup when it's aware that Bootstrap 4 is relevant (via it's {bslib} integration), then folks can also use tabs without the compatibility layer that comes by default with bs_theme()

library(shiny)
library(bslib)

ui <- fluidPage(
  theme = bs_theme() %>% bs_remove("bs3compat"),
  tabsetPanel(
    id = "tabset", type = "pills",
    tabPanel("A", "a"),
    tabPanel("B", "b"),
    navbarMenu(
      "More letters", 
      tabPanel("C", "c"),
      tabPanel("D", "d")
    )
  )
)

server <- function(input, output) {
  observe(print(input$tabset))
}

shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant