Skip to contents

The display() function adjusts how a tag element and its contents are rendered.

Usage

display(x, ...)

Arguments

x

A tag element or .style pronoun.

...

A character string specifying a display type. One of,

  • "none"

  • "inline"

  • "inline-block"

  • "block"

  • "grid"

  • "inline-grid"

  • "table"

  • "table-cell"

  • "table-row"

  • "flex"

  • "inline-flex"

    Use name-value pairs to specify breakpoints.

Value

An object of the same type as x.

Examples


library(htmltools)

div(
  .style %>%
    display("flex") %>%
    flex_justify("center"),
  "Powerful stuff"
)
#> <div class="d-flex justify-content-center">Powerful stuff</div>

div(
  .style %>%
    display(
      xs = "inline",
      md = "block"
    ),
  "Block and roll"
)
#> <div class="d-inline d-md-block">Block and roll</div>