Open mbacou opened 3 years ago
You can use htmltools::findDependencies to extract bs4Dash deps like here: https://unleash-shiny.rinterface.com/htmltools-dependencies.html#htmldeps-import
I've tried that route by adding adminLTE and bs4Dash deps to a shiny::navbarPage(bslib::bs_theme(version="4"))
, but I end up with a CSS soup (-: So I wouldn't recommend it.
Adding a simple (non-collapsible) top navbar to a bs4Dash page is easy enough (example below). I think the collapsible behavior will require extra work with custom JS/CSS. Any help welcome!
# Navbar ----
navbar <- dashboardHeader(
rightUi = tags$li(class="navbar-collapse collapse dropdown",
tags$ul(class="nav navbar-nav sidebar-menu",
bs4SidebarMenuItem("Page 1", tabName="page-1", selected=TRUE),
bs4SidebarMenuItem("Page 2", tabName="page-2"),
bs4SidebarMenuItem("Page 3", tabName="page-3")
)
)
)
In case others are interested, there's also the option to do without bs4Dash altogether and try to use widgets provided by other packages (summaryBox, timevis, shinyWidgets, etc.).
@DivadNojnarg I'd like to use bs4Dash elements (card, valueBox, timeline, etc..), but I need a more standard collapsible top navbar layout (similar to shiny::navbarPage), and I don't need bs4Dash sidebar and controlbar.
Is there a way to manually load bs4Dash CSS/JS dependencies? Or else can I tweak bs4Dash dashboard layout to include a (collapsible) top navbar?
Thx!