Grid
A responsive grid: a column count per width (cols="1 sm:2 lg:4") measured on the grid itself, or as many columns of a minimum width as fit. Children span columns with data-span.
Responsive to its own width: drag the corner
cols="1 xs:2 md:4": one column, two from 36em, four from 62em, measured on the grid (container queries), not the window.
Spans
As many as fit: min-col-width
gap, row-gap and align
API
For AI agents: this API as Markdown, or every component in llms-full.txt.
<ray-grid> · RayGrid
The widths are the grid's own (container queries: xs 36em, sm 48em, md 62em, lg 75em, xl 88em), so a grid in a narrow column or a phone frame drops to fewer columns. It needs a width from its parent: in a flex row give it one or let it grow. A child spans with data-span="2"…"12" or "full".
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
cols | cols reflects | string | 1 | Columns: a count, then counts from a width up ("1 sm:2 lg:4"). |
minColWidth | min-col-width | string | Instead of cols: as many columns of at least this width as fit ("14rem", 220). | |
gap | gap reflects | string | md | Space between cells: xs…xl, a number (px) or a CSS length. |
rowGap | row-gap | string | Space between rows when it differs from gap. | |
align | align reflects | stretch | start | center | end | stretch | Vertical alignment of the cells in a row. |
| Slot | Description |
|---|---|
| (default) | The cells (data-span="2" or "full" to span). |
| Part | Description |
|---|---|
grid | The grid element. |