text_wrap: Text wrap

View source: R/text-wrap.R

text_wrapR Documentation

Text wrap

Description

The text_wrap() adjusts how text is wrapped, or not wrapped, in a tag element.

Usage

text_wrap(x, wrap)

Arguments

x

A tag element or .style pronoun.

wrap

A boolean. One of,

  • TRUE

  • FALSE

Value

An object of the same type as x.

See Also

Other text utilities: text_alignment(), text_break(), text_color(), text_decoration(), text_height(), text_selection(), text_style(), text_transform(), text_weight()

Examples


library(htmltools)

div(
  style = "width: 5rem;",
  .style %>%
    background_color(theme_primary()) %>%
    text_wrap(TRUE),
  "Wrap text to fit the element"
)

div(
  style = "width: rem;",
  .style %>%
    background_color(theme_secondary()) %>%
    text_wrap(FALSE),
  "This text won't wrap onto a new line."
)


cascadess documentation built on Oct. 30, 2024, 9:29 a.m.