background: Background color

Description Usage Arguments See Also Examples

View source: R/design.R

Description

Use background() to modify the background color of a tag element.

Usage

1
background(tag, color)

Arguments

tag

A tag element.

color

One of "red", "purple", "indigo", "blue", "cyan", "teal", "green", "yellow", "amber", "orange", "grey", "black" or "white" specifying the background color of the tag element, defaults to NULL

See Also

Other design utilities: active(), affix(), border(), display(), float(), font(), height(), padding(), scroll(), shadow(), width()

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
### Modifying input elements

checkbarInput(
  id = "bar1",
  choices = c(
    "Nunc rutrum turpis sed pede.",
    "Etiam vel neque.",
    "Lorem ipsum dolor sit amet."
  )
) %>%
  background("cyan")

### Possible colors

colors <- c(
  "red", "purple", "indigo", "blue", "cyan", "teal", "green",
  "yellow", "amber", "orange", "grey", "white"
)

div(
  lapply(
    colors,
    background,
    tag = div() %>%
      padding(5) %>%
      margin(2)
  )
) %>%
  display("flex") %>%
  flex(wrap = TRUE)

yonder documentation built on Jan. 11, 2020, 9:35 a.m.