Usage
Grid arranges content in rows and columns with consistent gutters—ideal for card dashboards, form columns, and responsive feature grids. Prefer it when alignment must hold in two axes simultaneously; prefer FlexBox when layout is primarily one-dimensional.
useContainerQueries keeps columns tied to the pane, not only the viewport.FlexBox with gap is easier to reason about.FlexBox or Toolbar patterns fit better.gap should come from design tokens and shared constants—avoid one-off magic numbers in product code. For card galleries that should add columns as the container grows, use template={GridTemplate.AutoFillMinItem} (--layout-grid-auto-fill-min, 216px at a 16px root).
Grid container, track definitions, cells as direct children or nested regions. Container query hooks enable pane-aware breakpoints.
aria order is corrected.gap over per-cell margins—cleaner and more themeable.useContainerQueries when grids live inside chat dividers, drawers, or resizable analytics panes (common in dispatch).