Page grid
The two grids a product page is made of — tiles that auto-fill, charts that step 1 → 2 → 3 on the content column.
{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}
The two grids a product page is made of — tiles that auto-fill, charts that step 1 → 2 → 3 on the content column.
Import
import { KpiRow, ChartGrid } from "@ir/ui";Props
Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's.
Do and don't
Use KpiRow and ChartGrid.
Don't — Write grid grid-cols-tiles gap-gutter, or grid-cols-1 @3xl:grid-cols-2 @7xl:grid-cols-3, by hand on a page.
The rule used to live only in a sentence, so every product re-derived it and could drift without anyone noticing. A rule in a component is a rule that runs.
Let the grid answer to its container.
Don't — Reach for xl: or 2xl: inside the content column.
The viewport knows nothing about the rail, the page padding, a width cap or an open drawer. The same grid gets 976 at a 1280 viewport with the rail open and 1184 with it collapsed, so a viewport breakpoint is wrong at the width the grid was actually given.
Put it beside the grid.
Don't — Put a table or a time series in a ChartGrid.
Tables and time series take the full row at every width — they are not one of three columns, they are the row. A cell that must always span every column is not a cell.
Give the chart a fixed height range, 240–320.
Don't — Give the grid an aspect ratio so the charts scale with it.
An aspect ratio makes a chart grow tall on a wide screen, which nobody asked for. The grid sets columns and gap; height is the chart's own business.
Accessibility
- Both are presentational containers — they add no role and no landmark, so the tiles and cards inside keep whatever semantics they came with.
- Column count changes with the container, not with a media query, so a zoomed page reflows the same way a narrow one does. Reflow at 400% is a container question here, which is the point.
Where it is drawn
Not drawn in Figma. KpiRow and ChartGrid were built in code first; the reflow rule they implement is documented on the App shell page (section 'Content width — wide screens', 40000622:1068), which is a docs section rather than a component.