dq_box: Creates a html box with specified parameters

Description Usage Arguments Value Author(s) Examples

View source: R/dq_box.R

Description

Creates a fully customizable HTML box holding the given content. Can be made collapsible and nested.

Function to update the collapsed state of a dq_box.

Usage

1
2
3
4
5
6
dq_box(..., id = NULL, title = NULL, color = "#000",
  bg_color = "#ff8f00", fill = TRUE, width = 6L, height = NULL,
  offset = 0L, collapsible = FALSE, collapsed = FALSE,
  open_callback = FALSE)

update_dq_box(id, collapsed = NULL, silent = FALSE)

Arguments

...

Tags to add to the box as children.

id

ID of the box, can be used to observe collapse events via input[[paste0(id, "_collapser")]].

title

Title of the box, always visible.

color

Optional, sets the font color of the box, can be any valid html color, defaults to black.

bg_color

Optional, sets the background color of the box, can be any valid html color, defaults to dq primary orange.

fill

Optional logical, decide whether to fill the body with background color or not, if not, a border of this color will be set instead.

width

Optional, width of the box measured in bootstrap columns.

height

Optional, height of the box, can be numeric, which will result in pixels, or measured in any valid CSS3 length format, if the given body is larger than this value overflow will be set to auto, resulting in a scrollable body.

offset

Optional, offset of the resulting column measured in bootstrap columns.

collapsible

Optional logical, whether the box is collapsible or not.

collapsed

Optional logical, whether the box is initially collapsed or not.

open_callback

optional logical, whether to send messages whenever the state of the box changes or not, events will be available via input[[paste0(id, "_open")]]

silent

optional logical indicating to suppress events or not

Value

bootstrap column holding the box

Author(s)

richard.kunze

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
## Only run examples in interactive R sessions
if (interactive()) {

library(shiny)
shinyApp(
  ui = fluidPage(
    fluidRow(
      dq_box(
        title = "Say Hello to my children", id = "bigBox", collapsed = TRUE,
        dq_infobox("hallo", 2, "Welt", icon("hashtag"),
                   bg_color = "black", color = "#D00"),
        dq_box(
          title = "Box in the box", bg_color = "pink", width = 8,
          dq_infobox("in the box...", 2, "in the box!", width = 12,
                     bg_color = "white", color = "#0D0")
          )
        ),
      column(3, actionButton("toggle", "Toggle Box"))
     )
  ),
  server = function(input, output) {
    observeEvent(input$toggle, update_dq_box("bigBox"))
  }
)

}

dqshiny documentation built on May 2, 2019, 1:43 p.m.