flex_content: Flex content

View source: R/flex-content.R

flex_contentR Documentation

Flex content

Description

The flex_content() function adjusts how a tag element's child elements align as a group on the cross axis (see flex_justify() for more info about the main and cross axis of a flex element). Note, this alignment has no effect on a single row of child elements.

Usage

flex_content(x, ...)

Arguments

x

A tag element or .style pronoun.

...

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

  • "start"

  • "end"

  • "center"

  • "between"

  • "around"

  • "stretch"

    Use name-value pairs to specify breakpoints.

Value

An object of the same type as x.

See Also

Other flex utilities: flex_align(), flex_direction(), flex_display(), flex_justify(), flex_wrap(), item_align(), item_fill(), item_grow(), item_order()

Examples


library(htmltools)

div(
  .style %>%
    flex_display() %>%
    flex_content("center") %>%
    flex_wrap(TRUE),
  div("Flex item"),
  div("Flex item"),
  div("Flex item"),
  div("Flex item"),
  div("Flex item")
)

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