layout primitive
<tc-grid>
Auto-fit responsive grid. Children fill columns sized by a minimum width, or a fixed column count.
import
"@ra9/tan-compose-kit/grid"
Props
| Name | Type | Default | Description |
|---|---|---|---|
min | string | "260px" | Minimum column width as a CSS length. The grid auto-fits as many columns as can fit at that width or larger. |
gap | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | CSS length | "4" | Spacing between cells. Numeric tokens map to `--tc-space-N`. |
columns | string (number) | "" | Fixed column count. When set, overrides `min` and produces exactly N equal columns. |
Slots
| Slot | Description |
|---|---|
(default) | Cells — any markup; each direct child becomes one grid cell. |
Examples
Basic usage
Auto-fit — the grid figures out how many columns fit at the minimum width and reflows on resize.
Fixed columns
Pass columns="3" and the grid produces exactly three equal columns, ignoring min.
KPI strip
Combine with tc-stat for a responsive metrics row.
Card gallery
Theming
No theme variables. Use the min, columns, and gap props.
Accessibility
- Renders a plain
<div>withdisplay: grid— transparent to assistive tech. - Children retain their own semantics; the grid doesn't intercept focus or interactions.
- For ordered content where the visual order matters (e.g. a tabular layout), reach for
tc-tableinstead — the grid does not announce row/column structure.