Skip to content

Grid

Open .md
Live preview

Loading example…

Equal-width grid. With columns the count is fixed; otherwise it is intrinsic (auto-fill from minColumnWidth), so it reflows by the space it gets without breakpoints.

import { Grid } from "@jcsoftdev/ui/containers";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/containers/grid.

<Grid look={Stack} />
Prop Type Default Description
columns number Fixed number of equal columns. Without it the grid fits as many columns as minColumnWidth allows.
minColumnWidth string "16rem" Narrowest a column may get before the grid drops one (any CSS length). Defaults to 16rem.
gap "sm" | "md" | "lg" | "xs" | "none" | "xl" "md" Space between cells. Defaults to md.

* marks a required prop.

It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).

packages/ui/src/containers/grid/grid.tsx