Learn R Programming

yonder (version 0.2.0)

background: Background color

Description

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

Usage

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

Run this code
# NOT RUN {
### 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)

# }

Run the code above in your browser using DataLab