Learn R Programming

yonder (version 0.0.5)

display: Tag element display

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. Most of the time you will use the render argument. However if you want to control how an element appears (or does not appear) when the page is printed use the print argument.

Usage

display(.tag, render = NULL, print = NULL)

Arguments

.tag

A tag element.

render, print

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

See Also

Other design: active, affix, background, border, float, font, height, padding, scroll, shadow, width

Examples

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

### Printing pages

# This element is not shown when the page is printed.

div() %>%
  height(4) %>%
  background("orange") %>%
  display(print = "none")  # <-

# }

Run the code above in your browser using DataLab