bs4Box: AdminLTE3 simple box

Description Usage Arguments Author(s) Examples

View source: R/cards.R

Description

Create nice and epurated box

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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))
     })
   }
 )
}

RX-PBB/bs4Mash documentation built on April 11, 2020, 12:15 a.m.