grid: Generate CSS grid properties

View source: R/container.R

gridR Documentation

Generate CSS grid properties

Description

Returns a named list of CSS grid properties suitable for splicing into condition via the !!! operator.

Usage

grid(
  template_areas = NULL,
  template_rows = NULL,
  template_columns = NULL,
  gap = NULL,
  align_items = NULL,
  justify_items = NULL,
  align_content = NULL,
  justify_content = NULL,
  auto_columns = NULL,
  auto_rows = NULL,
  auto_fill = FALSE,
  ...
)

Arguments

template_areas

List of character vectors defining grid template areas. Each vector represents a row: list(c("a", "b"), c("c", "d")) produces "a b" "c d".

template_rows

CSS value for grid-template-rows.

template_columns

CSS value for grid-template-columns.

gap

CSS value for gap.

align_items

CSS value for align-items.

justify_items

CSS value for justify-items.

align_content

CSS value for align-content.

justify_content

CSS value for justify-content.

auto_columns

CSS value for column sizing. When auto_fill = TRUE, used in repeat(auto-fill, ...) for grid-template-columns. Otherwise maps to grid-auto-columns.

auto_rows

CSS value for row sizing. When auto_fill = TRUE, used in repeat(auto-fill, ...) for grid-template-rows. Otherwise maps to grid-auto-rows.

auto_fill

Logical. When TRUE, wraps auto_columns/auto_rows in repeat(auto-fill, ...).

...

Additional named CSS properties to include.

Value

A named list of CSS properties.

Examples

# Two-column layout
grid(template_areas = list(c("sidebar", "main")))

# Responsive auto-fill columns
grid(auto_fill = TRUE, auto_columns = "minmax(200px, 1fr)")


shinyGizmo documentation built on Nov. 27, 2026, 5:07 p.m.