boxLayout: Bootstrap 4 container for cards

Description Usage Arguments Note See Also Examples

Description

Bootstrap 4 container for cards

Alias to bs4CardLayout See bs4CardLayout for full details

Usage

1
2
3
bs4CardLayout(..., type = c("group", "deck", "columns"))

boxLayout(..., type = c("group", "deck", "columns"))

Arguments

...

Slot for bs4Dash cards.

type

Container type. See https://getbootstrap.com/docs/4.0/components/card/#card-layout for more details.

Note

Cards must have width argument set to NULL.

See Also

Other cards: bs4SocialCard(), bs4TabCard(), bs4UserCard(), descriptionBlock(), renderbs4InfoBox(), renderbs4ValueBox()

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
if (interactive()) {
  library(shiny)
  library(bs4Dash)

  # with group
  shinyApp(
    ui = dashboardPage(
      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        boxLayout(
          type = "group",
          lapply(1:4, function(i) {
            box(
              width = NULL,
              title = paste("Card", i),
              closable = FALSE,
              collapsible = FALSE,
              "Lorem ipsum is so fun!"
            )
          })
        )
      ),
      controlbar = dashboardControlbar(),
      title = "Box layout group"
    ),
    server = function(input, output) {}
  )

  # with deck
  shinyApp(
    ui = dashboardPage(
      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        boxLayout(
          type = "deck",
          lapply(1:4, function(i) {
            box(
              width = NULL,
              title = paste("Card", i),
              closable = FALSE,
              collapsible = FALSE,
              "Lorem ipsum is so fun!"
            )
          })
        )
      ),
      controlbar = dashboardControlbar(),
      title = "Box layout deck"
    ),
    server = function(input, output) {}
  )

  # with columns
  shinyApp(
    ui = dashboardPage(
      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        boxLayout(
          type = "columns",
          lapply(1:12, function(i) {
            box(
              width = NULL,
              title = paste("Card", i),
              closable = FALSE,
              collapsible = FALSE,
              height = if (i %% 2 == 1) "200px",
              status = if (i %% 2 == 0) "primary",
              if (i %% 2 == 0) "Lorem ipsum is so fun!",
              if (i == 1 | i == 7 | i == 12) img(src = "https://via.placeholder.com/290x160")
            )
          })
        )
      ),
      controlbar = dashboardControlbar(),
      title = "Box layout columns"
    ),
    server = function(input, output) {}
  )
}

hiplot/bs4Dash2 documentation built on Dec. 20, 2021, 3:51 p.m.