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.

Source on GitHub

Responsive to its own width: drag the corner
data-span="full": a row of its own

cols="1 xs:2 md:4": one column, two from 36em, four from 62em, measured on the grid (container queries), not the window.

Spans
data-span="2"11 1data-span="3" data-span="full"
As many as fit: min-col-width
blue
teal
violet
pink
orange
green
yellow
red
gap, row-gap and align
gap="xl"align="center"row-gap="xs" 456
Code

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".

PropertyAttributeTypeDefaultDescription
colscols reflectsstring1Columns: a count, then counts from a width up ("1 sm:2 lg:4").
minColWidthmin-col-widthstringInstead of cols: as many columns of at least this width as fit ("14rem", 220).
gapgap reflectsstringmdSpace between cells: xs…xl, a number (px) or a CSS length.
rowGaprow-gapstringSpace between rows when it differs from gap.
alignalign reflectsstretch | start | center | endstretchVertical alignment of the cells in a row.
SlotDescription
(default)The cells (data-span="2" or "full" to span).
PartDescription
gridThe grid element.