bslib
bslib copied to clipboard
Feature Request: allow specifying nav style for `page_navbar()`
BS5 made changing the style of the nav component nicely straightforward, https://getbootstrap.com/docs/5.3/components/navs-tabs/#available-styles. I am hoping bslib could allow developers to add the various nav style classes to the nav component of page_navbar()
. Alternatively, the developer could pass in a navset_
call?
You can do a good amount of this today via tagAppendAttributes()
's new-ish .cssSelector
:
library(bslib)
library(htmltools)
navset_card_pill(nav_panel("A", "a"), nav_panel("B", "b")) |>
tagAppendAttributes(class = "justify-content-center", .cssSelector = ".nav")
Note that {bslib}
isn't yet up-to-date with Bootstrap 5.3 though, so .nav-underline
doesn't work (yet)
I'm currently using a small bit of JS to apply the nav-pills
class to the navigation bar nav.
FYI: In the next release (or current dev) we now have navset_underline()
, navset_card_underline()
and page_navbar(underline = TRUE)
.
I'm leaving this issue open though because we should still think about a way to pass attributes to the navset constructor.