Skip to contents

The item_grow() and item_shrink() adjust a tag element's ability to grow or shrink inside a flex element.

Usage

item_grow(x, ...)

item_shrink(x, ...)

Arguments

x

A tag element or .style pronoun.

...

A boolean specifying to grow or shrink. One of,

  • TRUE

  • FALSE

    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(),
  div(
    .style %>%
      padding_all(2) %>%
      item_grow(TRUE),
    "Flex item"
  ),
  div(
    .style %>%
      padding_all(2),
    "Flex item"
  ),
  div(
    .style %>%
      padding_all(2),
    "Flex item"
  )
)
#> <div class="d-flex">
#>   <div class="p-2 flex-grow-1">Flex item</div>
#>   <div class="p-2">Flex item</div>
#>   <div class="p-2">Flex item</div>
#> </div>