Grid
CSS Grid layout with configurable columns, gaps, and alignment; columns,
the gaps and the alignment props accept a responsive object keyed by
breakpoint. Compose column spans with GridCol children.
Usage
Best practices
Gridgives full 2-D control - composeGridColchildren withspan/start/order; if you only need equal-width responsive columns,SimpleGridis lighter.columns,gap, and alignment each accept a per-breakpoint object;responsiveMode="container"resolves them against the nearest container query.For a grid whose tracks come from its own className or its children (
grid-cols-[...],grid-flow-col), passcolumns="none": it emits no column classes and no default alignment."none"is a whole value, not a breakpoint key.inline(a boolean) rendersinline-grid.asandrenderare mutually exclusive (renderwins, dev-warned);asdraws from the closed layout vocabulary, soas="button"is a type error (useButton).Use
asto change the element (a tag); userenderonly to swap in a component (e.g. a router Link). Neverrender={<Box as=…/>}- passasdirectly.
Props
Grid
GridCol
Also exports
- interface
GridColProps - interface
GridProps