Learn R Programming

shinydashboardPlus (version 0.2)

boxPlus: Create a box for the main body of a dashboard

Description

Boxes can be used to hold content in the main body of a dashboard.

Usage

boxPlus(..., title = NULL, footer = NULL, status = NULL,
  solidHeader = FALSE, background = NULL, width = 6, height = NULL,
  collapsible = FALSE, collapsed = FALSE, closable = TRUE,
  enable_label = FALSE, label_text = NULL, label_status = "primary",
  footer_padding = TRUE)

Arguments

...

Contents of the box.

title

Optional title.

footer

Optional footer text.

status

The status of the item This determines the item's background color. Valid statuses are listed in validStatuses.

solidHeader

Should the header be shown with a solid color background?

background

If NULL (the default), the background of the box will be white. Otherwise, a color string. Valid colors are listed in validColors.

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 valueBox 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.

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 collapsible=TRUE.

closable

If TRUE, display a button in the upper right that allows the user to close the box.

enable_label

Whether to display a label in the boxtool.

label_text

label text.

label_status

status of the box label: "danger", "success", "info", "primary", "warning".

footer_padding

TRUE by default: whether the footer has margin or not.

Examples

Run this code
# NOT RUN {
## Only run this example in interactive R sessions
if (interactive()) {
 library(shiny)
 library(shinydashboard)

 shinyApp(
   ui = dashboardPagePlus(
     dashboardHeaderPlus(),
     dashboardSidebar(),
     dashboardBody(
      fluidRow(
       boxPlus(
        title = "Closable Box", 
         closable = TRUE, 
         label_status = "danger",
         status = "warning", 
         solidHeader = FALSE, 
         collapsible = TRUE,
         p("Box Content")
       ),
       boxPlus(
        title = "Closable box, with label", 
         closable = TRUE, 
         enable_label = TRUE,
         label_text = 1,
         label_status = "danger",
         status = "warning", 
         solidHeader = FALSE, 
         collapsible = TRUE,
         p("Box Content")
       )
     )
    )
   ),
   server = function(input, output) {}
 )
}
# }

Run the code above in your browser using DataLab