rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
472 stars 57 forks source link

Cannot set class of navset cards #1075

Open gadenbuie opened 3 months ago

gadenbuie commented 3 months ago

navset_card_tab() creates a tabbed card, but doesn't include all of the arguments of card(). In particular, you cannot give the card a class without reaching for htmltools::tagAppendAttributes().

library(bslib)

navset_card_tab(
  class = "bg-text-primary",
  nav_panel("One", "First panel")
)
#> Error in buildTabset(..., ulClass = paste0("nav nav-", type), id = id, : Tabs should all be unnamed arguments, but some are named: class

(Not that .text-bg-primary would look great on a navset_card_tab(), adding the class reveals other styling issues. That said, it should at least be possible.)