display: Display property

Description Usage Arguments See Also Examples

View source: R/design.R

Description

Use the display() utility to adjust how a tag element is rendered. All arguments are responsive allowing you to hide elements on small screens or convert elements from inline to block on large screens.

Usage

1
display(tag, type)

Arguments

tag

A tag element.

type

A responsive argument. One of "inline", "block", "inline-block", "flex", "inline-flex", or "none".

See Also

Other design utilities: active(), affix(), background(), border(), 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
### Using flexbox

# When using `flex()` be sure to set the display, too.

div(
  lapply(
    1:5,
    function(i) {
      div() %>%
        padding(5) %>%
        margin(top = c(xs = 2), bottom = c(xs = 2)) %>%
        background("blue")
    }
  )
) %>%
  display("flex") %>%
  flex(
    direction = c(xs = "column", sm = "row"),
    justify = c(sm = "around")
  )

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