# Grid

Supply UI 1.1.0. Layout.

Equal columns, as many as fit. Items in a row grow to the tallest, so cards line up with their footers at the foot; `top` keeps each at its own height (a form beside a tall picture)

As many equal columns of at least `min` as fit. Items in a row grow to the tallest (cards line up, their footers at the foot); `top` keeps each at its own height, for a form beside a tall picture.

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `gap` | `1 \| 2 \| 3 \| 4 \| 6 \| 8 \| 12` |  | The space between the columns and rows; the page's gutter by default. |
| `min` | `string` |  | The lowest value it allows. |
| `top` | `boolean` |  | Keeps each item at its own height instead of growing to the tallest in its row. |

It also takes the 280 attributes of the element or UI SDK part it renders (`className`, `aria-label`, events…).

## Without React

Classes: `ui-grid` + `--min`, `ui-grid--top`

## Layout: notes

**States.** Layout follows the box it is in, not the window: `Split`, `Grid`, `AppShell` and the site parts stack when their box is narrow, at any width of the window.

**Do**
- Space with `gap` (`Stack`, `Row`, `Grid`), never with margins on children.
- Put the page's sections straight on the page, under their titles; a `Card` is one thing a person picks or acts on.
- Check every screen at 320, 375 and 768 px with the narrow check of rule 10.

**Don't**
- Don't give a box a fixed width, or a `min-height` together with an `aspect-ratio`.
- Don't nest a card in a card.
- Don't put two `<main>`s on a page: a screen shown inside another page takes `Main as="div"`.
