The item_grow()
and item_shrink()
adjust a tag element's ability to grow
or shrink inside a flex element.
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.
See also
Other flex utilities:
flex_align()
,
flex_content()
,
flex_direction()
,
flex_display()
,
flex_justify()
,
flex_wrap()
,
item_align()
,
item_fill()
,
item_order()
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>