Wraps a 1d sequence of UI elements into a 2d grid. The number of columns (and
rows) in the grid dependent on the column width as well as the size of the
display. For more explanation and illustrative examples, see here
layout_column_wrap(
width,
...,
fixed_width = FALSE,
heights_equal = c("all", "row"),
fill = TRUE,
fillable = TRUE,
height = NULL,
height_mobile = NULL,
gap = NULL,
class = NULL
)The desired width of each card, which can be any of the following:
A (unit-less) number between 0 and 1.
This should be specified as 1/num, where num represents the number
of desired columns.
Either the minimum (when fixed_width=FALSE) or fixed width
(fixed_width=TRUE).
NULL
Allows power users to set the grid-template-columns CSS property
manually, either via a style attribute or a CSS stylesheet.
Unnamed arguments should be UI elements (e.g., card())
Named arguments become attributes on the containing htmltools::tag element.
Whether or not to interpret the width as a minimum
(fixed_width=FALSE) or fixed (fixed_width=TRUE) width when it is a CSS
length unit.
If "all" (the default), every card in every row of the
grid will have the same height. If "row", then every card in each row
of the grid will have the same height, but heights may vary between rows.
Whether or not to allow the layout to grow/shrink to fit a
fillable container with an opinionated height (e.g., page_fillable()).
Whether or not each element is wrapped in a fillable container.
Any valid CSS unit (e.g.,
height="200px"). Doesn't apply when a card is made full_screen
(in this case, consider setting a height in card_body()).
Any valid CSS unit to use for the height when on mobile devices (or narrow windows).
A CSS length unit defining the
gap (i.e., spacing) between elements provided to .... This argument is only applicable when fillable = TRUE
Additional CSS classes for the returned UI element.
x <- card("A simple card")
# Always has 2 columns (on non-mobile)
layout_column_wrap(1/2, x, x, x)
# Has three columns when viewport is wider than 750px
layout_column_wrap("250px", x, x, x)
Run the code above in your browser using DataLab