Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bs4Box

AdminLTE3 simple box


Description

Create nice and epurated box

Usage

bs4Box(..., title = NULL, width = 6, height = NULL)

Arguments

...

Body content.

title

Box title.

width

The width of the box, using the Bootstrap grid system.

height

The height of a box, in pixels or other CSS unit. By default the height scales automatically with the content.

Author(s)

David Granjon, dgranjon@ymail.com

Examples

if(interactive()){
 library(shiny)
 library(bs4Dash)
 
 shiny::shinyApp(
   ui = bs4DashPage(
     navbar = bs4DashNavbar(),
     sidebar = bs4DashSidebar(
      bs4SidebarMenu(
       bs4SidebarHeader("Main content"),
       bs4SidebarMenuItem(
         "Basic boxes",
         tabName = "boxes",
         icon = "desktop"
       )
      )
     ),
     controlbar = bs4DashControlbar(),
     footer = bs4DashFooter(),
     title = "test",
     body = bs4DashBody(
      bs4TabItems(
       bs4TabItem(
         tabName = "boxes",
         fluidRow(
          bs4Box(
           height = "600px",
           title = "Box 1",
           plotOutput("plot"),
           column(
            width = 12,
            align = "center",
            sliderInput(
              "obs",
              "Number of observations:",
              min = 0, max = 1000,
              value = 500
            )
           )
          ),
          bs4Box(
           height = "600px",
           title = "Box 2",
           plotOutput("distPlot"),
           column(
            width = 12,
            align = "center",
            radioButtons(
              "dist", 
              inline = TRUE,
              "Distribution type:",
              c("Norm" = "norm",
                "Unif" = "unif",
                "LogNorm" = "lnorm",
                "Exp" = "exp")
            )
           )
          )
         )
       )
      )
     )
   ),
   server = function(input, output) {
    output$plot <- renderPlot({
     hist(rnorm(input$obs))
     })
     
     output$distPlot <- renderPlot({
       dist <- switch(
       input$dist,
       norm = rnorm,
       unif = runif,
       lnorm = rlnorm,
       exp = rexp,
       rnorm
     )
       
       hist(dist(500))
     })
   }
 )
}

bs4Dash

A 'Bootstrap 4' Version of 'shinydashboard'

v0.5.0
GPL (>= 2) | file LICENSE
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)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.