README.md

bs4Dash

R build status version lifecycle cranlogs total Codecov test coverage

Bootstrap 4 shinydashboard using AdminLTE3

New users moving to bs4Dash v2.0.0

Taking the simple {shinydashboard} example:

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(),
  dashboardBody(
    # Boxes need to be put in a row (or column)
    fluidRow(
      box(plotOutput("plot1", height = 250)),

      box(
        title = "Controls",
        sliderInput("slider", "Number of observations:", 1, 100, 50)
      )
    )
  )
)

server <- function(input, output) {
  set.seed(122)
  histdata <- rnorm(500)

  output$plot1 <- renderPlot({
    data <- histdata[seq_len(input$slider)]
    hist(data)
  })
}

shinyApp(ui, server)

Starting from v2.0.0, moving to {bs4Dash} is rather simple:

library(bs4Dash)
ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(),
  dashboardBody(
    # Boxes need to be put in a row (or column)
    fluidRow(
      box(plotOutput("plot1", height = 250)),

      box(
        title = "Controls",
        sliderInput("slider", "Number of observations:", 1, 100, 50)
      )
    )
  )
)

server <- function(input, output) {
  set.seed(122)
  histdata <- rnorm(500)

  output$plot1 <- renderPlot({
    data <- histdata[seq_len(input$slider)]
    hist(data)
  })
}

shinyApp(ui, server)

Upgrading bs4Dash to 2.0.0

Disclaimer: as of now, {bs4Dash} 2.0.0 needs:

shiny (>= 1.6.0)
htmltools (>= 0.5.1.1)
bslib (>= 0.2.4)
thematic (>= 0.1.2)

Installation

bs4Dash >= v2.0.0

# latest devel version
devtools::install_github("RinteRface/bs4Dash")

bs4Dash <= v0.5.0

This package is on CRAN:

# from CRAN
install.packages("bs4Dash")

Demo

bs4Dash >= v2.0.0

See a working example on shinyapps.io here. You may also run:

library(bs4Dash)
bs4DashGallery()

bs4Dash <= v0.5.0

See a preview of the package here and here or run

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

Issues

Issues are listed here.

Acknowledgement

I warmly thank Glyphicons creator for providing them for free with Bootstrap.

Code of Conduct

Please note that the bs4Dash project is released with a Contributor Code of Conduct. By contributing to this project, you agree toabide by its terms.



Try the bs4Dash package in your browser

Any scripts or data that you put into this service are public.

bs4Dash documentation built on July 23, 2021, 5:06 p.m.