Skip to content

RinteRface/bs4Dash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fdfda6e · Sep 3, 2024
Dec 20, 2022
Sep 3, 2024
Aug 20, 2024
Sep 3, 2024
Sep 3, 2024
Jan 23, 2024
Aug 20, 2024
Jul 29, 2022
Aug 20, 2024
Sep 3, 2024
May 5, 2022
Aug 20, 2024
Aug 28, 2020
Jun 16, 2023
Sep 3, 2024
Dec 3, 2018
Jun 15, 2023
Sep 3, 2024
Sep 3, 2024
Sep 3, 2024
Jan 29, 2019
Jan 21, 2020
Sep 3, 2024
Sep 3, 2024
Sep 3, 2024

Repository files navigation

bs4Dash

R build status version cranlogs total Codecov test coverage

Bootstrap 4 shinydashboard using AdminLTE3




From {shinydashboard} to {bs4Dash}

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)

Moving to {bs4Dash} is rather simple, as we just replace library(shinydashboard):

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)

Installation

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

Demo

You may also run:

library(bs4Dash)
bs4DashGallery()

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.