display: Display

Description Usage Arguments Block vs inline Examples

View source: R/display.R

Description

The display() function adjusts how a tag element is rendered. For example, to use the flex box layout the display must be "flex".

Usage

1

Arguments

x

A tag element or .style pronoun.

type

A responsive argument.

One of "inline", "inline-block", "block", "grid", "table", "table-cell", "table-row", "flex", "inline-flex", or "none".

Block vs inline

div(
  div(
    .style %>%
      border("blue"),
    "block"
  ),
  div(
    .style %>%
      border("blue"),
    "block"
  )
)
html_preserve

block

block

/html_preserve
div(
  div(
    .style %>%
      border("blue") %>%
      display("inline"),
    "inline"
  ),
  div(
    .style %>%
      border("blue") %>%
      display("inline"),
    "inline"
  )
)
html_preserve

inline

inline

/html_preserve

Examples

1
2
3
4
5
6
7
8
9
library(htmltools)

# When using flex make sure you specify the flex display.
div(
  .style %>%
    display("flex") %>%
    flex(justify = "center"),
  "Powerful stuff"
)

cascadess documentation built on Jan. 13, 2021, 5:10 p.m.