RinteRface / bs4Dash

Bootstrap 4 shinydashboard using AdminLTE3
https://bs4dash.rinterface.com
Other
441 stars 81 forks source link

Collapable boxes #334

Closed tkranenburg closed 1 year ago

tkranenburg commented 1 year ago

Dear bs4Dash developers,

Thanks for developing the bs4Dash package. I have a question with regards to boxes and collapsing them. When I use the boxes with the DashboardBody or DashboardPage, I can collapse the boxes. However, when I use the boxes in a normal shiny fluidPage, the collapse button does not appear to work. I am using the fluidPages as modules in a larger app. Is it correct that the boxes are only collapsible within a DashboardBody/Page or am I overlooking something? Thanks in advance.

Kind regards,

DivadNojnarg commented 1 year ago

Hi,

Theoretically, box is not supposed to work outside dashboardPage because the latter includes all necessary dependencies to make it work (JS, CSS, ...). However, {shinyWidgets} exposes useBs4Dash(): https://github.com/dreamRs/shinyWidgets/blob/c22f08105d6ac6ab047d8819376aa13ad67f2113/R/useBs4Dash.R, which allows to do it. See here for a thorough explanation: https://unleash-shiny.rinterface.com/htmltools-dependencies.html#htmldeps-import.

tkranenburg commented 1 year ago

Hi Divad,

Thanks a lot for point me in the right direction!