knack: Grillade knack

Description Usage Arguments Value Examples

View source: R/grillade.R

Description

Custom elements for grillade.

Usage

1
knack(..., cols = NULL, cols_sm = NULL, rows = NULL)

Arguments

...

Content of the column, named arguments will be used as tag attributes.

cols

Number of column taken by the element.

cols_sm

Number of column taken by the element on small screen.

rows

Number of rows taken by the element.

Value

An element that can be used inside grillade.

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
library(grillade)

# For examples
box_example <- function(...) {
  tags$div(
    style = "box-sizing:border-box;border:5px solid #1C6EA4;height:100%;",
    ...
  )
}

# Number of row taken by grid element
grillade(
  box_example("Column 1"),
  knack(
    row_height = 2,
    box_example("Column 2")
  ),
  box_example("Column 3"),
  n_col = 2,
  gutter = TRUE
)


# Specify columns width
grillade(
  knack(
    col_width = 3,
    box_example("Column 1")
  ),
  knack(
    col_width = 2,
    box_example("Column 2")
  ),
  knack(
    col_width = 2,
    box_example("Column 3")
  ),
  knack(
    col_width = 3,
    box_example("Column 4")
  ),
  n_col = 5,
  gutter = TRUE
)

dreamRs/grillade documentation built on May 2, 2020, 11:09 a.m.