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

Cannot set class of navset cards #1075

Open
gadenbuie opened this issue Jun 10, 2024 · 1 comment
Open

Cannot set class of navset cards #1075

gadenbuie opened this issue Jun 10, 2024 · 1 comment

Comments

@gadenbuie
Copy link
Member

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.)

@gadenbuie
Copy link
Member Author

Another request for this on forum.posit.co:

The bslib::card function has a class argument which allows to set the class of a card container. In contrast, the navset_card_tab function does not have such argument. However, when I explore the content of the Shiny app using the web developper tools, I can add the 'bg-dark' class to the div defining the header area (which is already assigned to class="card-header bslib-navs-card-title") and change this element to "dark mode".

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

No branches or pull requests

1 participant