Description Usage Arguments Author(s) See Also Examples
Build an adminLTE3 card
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 | bs4Card(
...,
inputId = NULL,
title = NULL,
footer = NULL,
status = NULL,
elevation = NULL,
solidHeader = FALSE,
headerBorder = TRUE,
gradientColor = NULL,
width = 6,
height = NULL,
collapsible = TRUE,
collapsed = FALSE,
closable = FALSE,
maximizable = FALSE,
label = NULL,
dropdownMenu = NULL,
overflow = FALSE,
sidebar = NULL
)
box(
...,
inputId = NULL,
title = NULL,
footer = NULL,
status = NULL,
elevation = NULL,
solidHeader = FALSE,
headerBorder = TRUE,
gradientColor = NULL,
width = 6,
height = NULL,
collapsible = TRUE,
collapsed = FALSE,
closable = FALSE,
maximizable = FALSE,
label = NULL,
dropdownMenu = NULL,
overflow = FALSE,
sidebar = NULL
)
|
... |
Contents of the box. |
inputId |
Get the state of the card. Optional. |
title |
Optional title. |
footer |
Optional footer text. |
status |
The status of the card header. "primary", "secondary", "success", "warning", "danger", "white", "light", "dark", "transparent". NULL by default. |
elevation |
Card elevation. |
solidHeader |
Should the header be shown with a solid color background? |
headerBorder |
Whether to display a border between the header and body. TRUE by default |
gradientColor |
If NULL (the default), the background of the box will be white. Otherwise, a color string. "primary", "success", "warning" or "danger". |
width |
The width of the box, using the Bootstrap grid system. This is
used for row-based layouts. The overall width of a region is 12, so the
default width of 4 occupies 1/3 of that width. For column-based
layouts, use |
height |
The height of a box, in pixels or other CSS unit. By default the height scales automatically with the content. |
collapsible |
If TRUE, display a button in the upper right that allows the user to collapse the box. |
collapsed |
If TRUE, start collapsed. This must be used with
|
closable |
If TRUE, display a button in the upper right that allows the user to close the box. |
maximizable |
If TRUE, the card can be displayed in full screen mode. |
label |
Slot for bs4CardLabel. |
dropdownMenu |
List of items in the the boxtool dropdown menu. Use dropdownItemList. |
overflow |
Whether to enable overflow in the card body and footer. FALSE by default. |
sidebar |
Slot for bs4CardSidebar. |
David Granjon, dgranjon@ymail.com
Other cards:
bs4InfoBox()
,
bs4TabCard()
,
bs4ValueBox()
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)
shiny::shinyApp(
ui = bs4DashPage(
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(),
controlbar = bs4DashControlbar(),
footer = bs4DashFooter(),
title = "test",
body = bs4DashBody(
fluidRow(
column(
width = 6,
bs4Card(
title = "Closable Box with dropdown",
closable = TRUE,
width = 12,
status = "warning",
solidHeader = FALSE,
collapsible = TRUE,
label = bs4CardLabel(
text = 1,
status = "danger",
tooltip = "Hello!"
),
dropdownMenu = dropdownItemList(
dropdownItem(url = "http://www.google.com", name = "Link to google"),
dropdownItem(url = "#", name = "item 2"),
dropdownDivider(),
dropdownItem(url = "#", name = "item 3")
),
p("Box Content")
)
),
column(
width = 6,
bs4Card(
title = "Closable Box with gradient",
closable = TRUE,
width = 12,
solidHeader = FALSE,
gradientColor = "success",
collapsible = TRUE,
p("Box Content")
)
)
),
fluidRow(
bs4Card(
title = "Closable Box with solidHeader",
closable = TRUE,
width = 6,
solidHeader = TRUE,
status = "primary",
collapsible = TRUE,
p("Box Content")
),
bs4Card(
inputId = "card4",
title = "Maximizable Card",
width = 6,
status = "warning",
closable = FALSE,
maximizable = TRUE,
collapsible = TRUE,
sliderInput("obs", "Number of observations:",
min = 0, max = 1000, value = 500
),
plotOutput("distPlot")
)
)
)
),
server = function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.