Skip to main content
  1. Docs
  2. Components
  3. Layout

Grid

Equal columns that change with the window's size class, with gaps from the space scale.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<div>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

grid.tsx
// From the package: a build keeps only what it uses.
import { Grid, GridItem } from "@qeetrix/react";

// Or from its own path.
import { Grid, GridItem } from "@qeetrix/react/grid";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
columns1 – 12 | { base, medium, expanded, large, xlarge }1Equal columns: one count, or one per window size class.
gap"none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl""md"Space between cells.
align"start" | "center" | "end" | "stretch""stretch"Cells in a row, up and down.
renderReactElementa <div>A <ul> around <li> GridItems.
GridItem: span · start1 – 12 | per size class1 · the next free cellColumns spanned, and the one it starts in; each size class inherits the nearest smaller one set.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
grid<div>data-gap, data-align.
grid-item<div>A spanning cell.

04

A detail page

The record's main column and its side column, side by side from 1200px.

user-page.tsx
<Grid columns={{ base: 1, large: 3 }} gap="xl">
  <GridItem span={{ large: 2 }}>
    <Card title="Profile" level={2}>…</Card>
  </GridItem>
  <Card title="Recent activity" level={2}>…</Card>
</Grid>
Next — GridAccessibility