wired_card: Wired Card

Description Usage Arguments Examples

View source: R/components.R

Description

Wired Card

Usage

1
2
wired_card(..., elevation = 2, fill = NULL, padding = 10,
  width = NULL)

Arguments

...

UI objects to be contained in the card.

elevation

Numerical number between 1-5 (inclusive) - sets the elevation of the card. Default is 2.

fill

A color to fill the background of the card in a sketchy format.

padding

Amount of padding to apply. Can be numeric (in pixels) or character (e.g. "3em").

width

The width of the input, e.g. 400px, or 100%; see validateCssUnit.

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
library(htmltools)
browsable(tagList(
  wired_card(
    "A sketchy card !"
  ),
  tags$br(),
  "Another with fill background:",
  wired_card(
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    " Vestibulum imperdiet, erat a porttitor sagittis,",
    " eros mauris finibus diam, porta venenatis enim leo ut libero.",
    " Morbi volutpat nibh ex, quis faucibus ante dictum vestibulum.",
    " Etiam cursus turpis in lorem rutrum, vitae imperdiet sem mollis.",
    " Mauris quis neque ac elit suscipit posuere.",
    fill = "red", width = "100%"
  )
))

if (interactive()) {

  library(shiny)
  library(wired)

  ui <- fluidPage(
    fluidRow(
      column(
        width = 4,
        wired_card("Simple card")
      ),
      column(
        width = 4,
        wired_card(
          "Another one with a plot!",
          plotOutput(outputId = "plot"),
          elevation = 5, width = "100%"
        )
      )
    )
  )

  server <- function(input, output, session) {

    output$plot <- renderPlot({
      plot(sin(seq(-pi, pi, length.out = 100)), type = "l")
    })

  }

  shinyApp(ui, server)
}

dreamRs/wired documentation built on Nov. 19, 2019, 5 a.m.