Grid

Arrange mixed components in a 2–3 column grid, with items that can span wider.

Primitive

≈ 802 tokens per use (tool 364 · guidance 192 · typical payload 246)How token costs are estimated

Example: Grid

Give me the Q4 launch at a glance.

Q4 launch: Team plan

At risk
Launch date
Tue 18 Nov
Open tasks
6 of 22
Owner
Noa S.
Blocker
Billing migration

Before launch

0 of 4 done

When to use

  • An overview made of several small, different components: KPIs, a chart, a short table, an insight, each from its own data.
  • Some items deserve more width than others.

When not to use

  • The items are the same kind, side by side for comparison. Use Columns.
  • It's one component. Call it on its own.
  • The items are long or interactive forms. Use a Stack.

How it works

items lists 2–9 components by catalog name. Each takes one column unless span says 2 or "full". On phones everything is one column:

{
  "columns": 2,
  "items": [
    { "component": "show_summary", "props": { "…": "…" } },
    { "component": "show_callout", "props": { "…": "…" } },
    { "span": "full", "component": "show_chart", "props": { "…": "…" } }
  ]
}

Like every layout it renders through the Renderer, may hold one more layout inside, and passes each interactive child's result up as { child, result }.

How the agent should use it

  • Order by importance, reading left to right, top to bottom. The first item is the headline.
  • One wide item, at most two: a chart or a table under a row of cards.
  • Keep items short. Cards, not documents.

Installation

npx shadcn@latest add https://your-site.com/r/layout-grid.json

Usage

lib/genui-catalog.ts
import { LayoutGrid } from "@/components/genui/layout-grid"

export const catalog = {
  show_grid: LayoutGrid,
  show_kpis: KpiCard,
  show_chart: Chart,
} satisfies GenUICatalog

Schema

PropTypeNotes
columns2 | 3Default 2. Always one column on phones
items{ component, props, id?, span? }[]2–9 components. span: 1, 2 or "full"

Host props: status and className. renderChild is injected by the Renderer.

Source

On this page