Build an adminLTE3 card
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 = TRUE,
maximizable = FALSE,
labelStatus = NULL,
labelText = NULL,
labelTooltip = NULL,
dropdownMenu = NULL,
dropdownIcon = "wrench",
overflow = FALSE,
enable_sidebar = FALSE,
sidebar_content = NULL,
sidebar_width = "25%",
sidebar_background = "#333a40",
sidebar_start_open = FALSE,
sidebar_icon = "cogs"
)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 = TRUE,
maximizable = FALSE,
labelStatus = NULL,
labelText = NULL,
labelTooltip = NULL,
dropdownMenu = NULL,
dropdownIcon = "wrench",
overflow = FALSE,
enable_sidebar = FALSE,
sidebar_content = NULL,
sidebar_width = "25%",
sidebar_background = "#333a40",
sidebar_start_open = FALSE,
sidebar_icon = "cogs"
)
Contents of the box.
Get the state of the card. Optional.
Optional title.
Optional footer text.
The status of the card header. "primary", "secondary", "success", "warning", "danger", "white", "light", "dark", "transparent". NULL by default.
Card elevation.
Should the header be shown with a solid color background?
Whether to display a border between the header and body. TRUE by default
If NULL (the default), the background of the box will be white. Otherwise, a color string. "primary", "success", "warning" or "danger".
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 NULL
for the width; the width is set by the column that
contains the box.
The height of a box, in pixels or other CSS unit. By default the height scales automatically with the content.
If TRUE, display a button in the upper right that allows the user to collapse the box.
If TRUE, start collapsed. This must be used with
collapsible=TRUE
.
If TRUE, display a button in the upper right that allows the user to close the box.
If TRUE, the card can be displayed in full screen mode.
status of the box label: "primary", "secondary", "success", "warning", "danger", "white", "light", "dark", "transparent".
Label text.
Label tooltip displayed on hover.
List of items in the the boxtool dropdown menu. Use dropdownItemList.
Dropdown icon. "wrench" by default.
Whether to enable overflow in the card body and footer. FALSE by default.
Whether to display the box sidebar. FALSE by default.
Box sidebar content, if any.
Box sidebar width in percentage. 25% by default. A character value of any width CSS understands (e.g. "100px")
Box sidebar background color. Dark by default.
Whether the box sidebar is open at start. FALSE by default.
Box sidebar icon.
Other cards:
bs4InfoBox()
,
bs4TabCard()
,
bs4ValueBox()
# NOT RUN {
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,
labelText = 1,
labelStatus = "danger",
labelTooltip = "Hi Bro!",
dropdownIcon = "wrench",
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,
status = "warning",
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(
title = "Maximizable Card",
width = 6,
status = "warning",
closable = FALSE,
maximizable = TRUE,
collapsible = FALSE,
sliderInput("obs", "Number of observations:",
min = 0, max = 1000, value = 500
),
plotOutput("distPlot")
)
)
)
),
server = function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
}
)
}
# }
Run the code above in your browser using DataLab