Skip to content

Cell

Grid cell spanning columns/rows.

Updated View as Markdown
Preview

Loading preview…

root = Grid(Cell(Card(Header("Main chart", "Spans two columns", size:sm)), span:2), Card(Header("Side", size:sm)), cols:3)

Signature

This is the line a model reads in the system prompt.

Cell(...children, span:num, rows:num, gap:Gap)
  • Group: Layout
  • Children: Yes: any component or text
  • Positional arguments: none

Props

Prop Type How to write it Notes
span number named: span:…
rows number named: rows:…
gap none · xs · sm · md · lg · xl named: gap:… Also accepts small, medium, large.

Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model’s output do not change.

import { ui } from "@gistui/react/ui";

const lib = ui.extend({ Cell: MyCell });
<GistUI library={lib} stream={response.body} />;
<GistUI :source="answer" :components="{ Cell: MyCell }" />
<GistUI source={answer} components={{ Cell: MyCell }} />
<GistUI source={answer()} components={{ Cell: MyCell }} />
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ Cell: (ctx) => ({ el: myElement(ctx) }) });

See Custom components for the full contract. Style hook: [data-gistui="Cell"].

Navigation

Type to search…

↑↓ navigate↵ selectEsc close