Skip to contents

The text_transform() function adjusts the case of text in a tag element.

Usage

text_transform(x, transform)

Arguments

x

A tag element or .style pronoun.

transform

A character string specifying the transform. One of,

  • "uppercase"

  • "lowercase"

  • "capitalize"

Value

An object of the same type as x.

Examples


library(htmltools)

div(
  .style %>%
    text_transform("lowercase"),
  "TRANSFORMED TO LOWERCASE"
)
#> <div class="text-lowercase">TRANSFORMED TO LOWERCASE</div>

div(
  .style %>%
    text_color(theme_warning()) %>%
    text_transform("uppercase"),
  "transformed to uppercase"
)
#> <div class="text-warning text-uppercase">transformed to uppercase</div>