A 'Bootstrap 4' Version of 'shinydashboard'

Make 'Bootstrap 4' dashboards. Use the full power of 'AdminLTE3', a dashboard template built on top of 'Bootstrap 4' < https://github.com/almasaeed2010/AdminLTE/tree/v3-dev>.


Build Status version lifecycle Project Status


Important note

bs4Dash needs the following code to be added in the header in order to work on shinyapps.io:

shiny::tags$head(
  shiny::tags$script(
    "// handle shinyapps.io: we need to extract the worker id and
     // paste it in the url so that the apps works correctly
     // get the shiny app.io workerId
     var workerId = $('base').attr('href');
     // ensure that this code does not run on shiny server/pro and locally
     if (typeof workerId != 'undefined') {
       // get the initial page url
       var url = window.location.href;
       // get the name of the first selected tab
       // replace the url by the url for shinyapp.io
       window.location.replace(url + workerId);
     }
    "
  )
)

This code has to be embeded as follows:

library(shiny)
library(bs4Dash)
 
shiny::shinyApp(
  ui = bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter(),
    title = "test",
    body = bs4DashBody(
      shiny::tags$head(
        shiny::tags$script(
          "// handle shinyapps.io: we need to extract the worker id and
           // paste it in the url so that the apps works correctly
           // get the shiny app.io workerId
           var workerId = $('base').attr('href');
           // ensure that this code does not run on shiny server/pro and locally
           if (typeof workerId != 'undefined') {
             // get the initial page url
             var url = window.location.href;
             // get the name of the first selected tab
             // replace the url by the url for shinyapp.io
             window.location.replace(url + workerId);
           }
          "
        )
    )
  ),
  server = function(input, output) {}
)

This issue is fixed on the new github version but you need to wait for the next CRAN release (next week) since shinyapps.io uses the latest CRAN version.

See a working example here.

Installation

This package is on CRAN:

# from CRAN
install.packages("bs4Dash")
# latest devel version
devtools::install_github("DivadNojnarg/bs4Dash")

Demo

See a preview of the package here and here or run

library(bs4Dash)
# classic theme
bs4DashGallery()
# old_school theme
bs4DashGallery(theme = "old_school")

An applied example can be found here (the original dashboard was made by Philippine Rheins from dreamRs).

Issues

Issues are listed here.

News

bs4Dash 0.2.0

Major changes

  • bs4Dash now works on shinyapp.io (previously, there was a problem with tab navigation)
  • major update of all dependencies (bootstrap 4, fontawesome, ionicons, ...) with htmltools

Minor changes

  • close and collapse buttons not shown when the title is NULL in bs4Card()
  • bs4ValueBox() footer is not shown when the external link is NULL
  • bs4ValueBox() external link opens in a new page
  • add sidebar_collapsed argument to bs4DashPage() to control the sidebar opening at start
  • update bs4DashGallery(). Add a "theme" argument
  • add ionicon() (implementation of ionicons)
  • fix vignette titles
  • add a "fixed" argument to the bs4DashNavbar() (#7, thanks @theRcast)
  • update Readme

bs4Dash 0.1.0

  • initial release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("bs4Dash")

0.4.0 by David Granjon, 3 months ago


https://rinterface.github.io/bs4Dash/index.html, https://github.com/RinteRface/bs4Dash


Report a bug at https://github.com/RinteRface/bs4Dash/issues


Browse source code at https://github.com/cran/bs4Dash


Authors: David Granjon [aut, cre] , RinteRface [cph] , Almasaeed Studio [ctb, cph] (AdminLTE3 theme for Bootstrap 4) , Winston Chang [ctb, cph] (Utils functions from shinydashboard) , Thomas Park [ctb, cph] (Bootswatch Sketchy theme CSS)


Documentation:   PDF Manual  


GPL (>= 2) | file LICENSE license


Imports shiny, htmltools

Suggests plotly, shinyWidgets, knitr, rmarkdown


Suggested by shinyEffects, shinyWidgets.


See at CRAN