Open vibalre opened 1 month ago
Hi!
I got similar problem with page_navbar
.
I tried to add classes to router
but I couldn't implement it.
Also when I use nav_panel
it's not working well. It activated at the begining.
ui <- function() {
app_ui <- tagList(
page_navbar(
nav_item(
a("Home", href = route_link("/"))
),
nav_item(
a("Page1", href = route_link("page1"))
),
nav_panel(
title = "Page2", tagList(h2("Welcome"),h2("Page 2"))
)
),
router_ui(
route("/", tagList(h2("Welcome"),h2("Homepage"))),
route("page1",tagList(h2("Welcome"),h2("Page 1")))
)
)
all_tags <- htmltools::tagQuery(app_ui)
all_tags$find("#router-page-wrapper")$addClass("container-fluid html-fill-item html-fill-container")
all_tags$find(".router")$addClass("tab-pane html-fill-item html-fill-container bslib-gap-spacing")
all_tags$allTags()
}
server <- function(input,output, session) {
shiny.router::router_server()
}
shiny::shinyApp(ui, server)
Is there any way to use nav_panel
with shiny.router
?
Guidelines
Project Version
No response
Platform and OS Version
No response
Existing Issues
No response
What happened?
We are using
bslib:page_fillable
. Withoutshiny.router
, plots and cards are fillable. Withshiny.router
, plots and cards are no longer fillable.Steps to reproduce
bslib::page_fillable
.shiny.router::router_ui
.plotly
insideshiny.router::route
.plotly
.Expected behavior
The plots inside the router should still fill the page.
Attachments
Screenshots or Videos
No router
With router
Additional Information
Workaround for plots to fill page is to add classes to
.html-fill-container
and.html-fill-item
to both.router-page-wrapper
and.router
. It would be nice to have an easy way to add classes to these router classes.