Grid
CSS grid layout for two-dimensional arrangements with a fixed column count.
This is Orbital's fixed-column CSS grid for predictable column layouts. Compose with GridItem children to control span and offset per cell. For fluid card tiles that reflow with viewport width, use AutoGrid in the orbital crate.
- Dashboard tiles, form columns, responsive card grids - When both row and column alignment matter
- Set
config.colsto the number of grid columns. - Wrap each cell in
GridItem. - Use
GridItemConfig::spanto span multiple columns;offsetto skip columns. - Tune
config.x_gap/config.y_gapfor consistent spacing rhythm.
Three equal columns with consistent gaps—typical for dashboard tiles, metric cards, or icon grids.
Two-column layout with separate horizontal and vertical gaps for form pairs, settings rows, or side-by-side cards.
column=2 spans multiple grid columns so one cell can be wide while neighbors stay single-column.
offset=1 leaves an empty column at the start—useful for indented rows or staggered cards.
Cells use theme background tokens so grid layouts inherit light/dark surfaces from the provider.
Explicit single-column stack when cols=1 — useful for narrow panels or mobile-first layouts.