Skip to contents

The flex_align() function adjusts a tag element's cross axis alignment. By default, the cross axis is the y-axis. When using flex_direction("column") the cross axis becomes the x-axis.

Usage

flex_align(x, ...)

Arguments

x

A tag element or .style pronoun.

...

A character string specifying the cross axis alignment. One of,

  • "start"

  • "end"

  • "center"

  • "baseline"

  • "stretch"

    Use name-value pairs to specify breakpoints.

Value

An object of the same type as x.

See also

Examples


library(htmltools)

div(
  .style %>%
    flex_display() %>%
    flex_align("center"),
  div("Flex item"),
  div("Flex item"),
  div("Flex item")
)
#> <div class="d-flex align-items-center">
#>   <div>Flex item</div>
#>   <div>Flex item</div>
#>   <div>Flex item</div>
#> </div>