R/item-fill.R

Defines functions item_fill

Documented in item_fill

item_fill_values <- chr(
  "TRUE" = "fill"
)

#' Flex fill
#'
#' The `item_fill()` adjusts how tag elements fill a flex element.
#'
#' @param x `param_subject()`
#'
#' @param ... A boolean specifying to fill. One of
#'
#'   `r rd_bullets(names(item_fill_values))`
#'
#'   Use name-value pairs to specifying [breakpoints].
#'
#' @returns `r returns_same("x")`
#'
#' @family flex utilities
#'
#' @export
#'
#' @examples
#'
#' library(htmltools)
#'
#' div(
#'   .style %>%
#'     flex_display(),
#'   div(
#'     .style %>%
#'       item_fill(TRUE),
#'     "Flex item"
#'   ),
#'   div(
#'     .style %>%
#'       item_fill(TRUE),
#'     "Flex item"
#'   ),
#'   div(
#'     .style %>%
#'       item_fill(TRUE),
#'     "Flex item"
#'   )
#' )
#'
item_fill <- function(x, ...) {
  add_class(
    x,
    compose_class(
      "flex",
      item_fill_values,
      ...
    )
  )
}

Try the cascadess package in your browser

Any scripts or data that you put into this service are public.

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