Skip to content

Stack

Vertical stack.

Updated View as Markdown
Preview

Loading preview…

root = Stack(Tag("First"), Tag("Second"), Tag("Third"), gap:sm, align:start)

Signature

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

Stack(...children, gap:Gap, align:Align, justify:Justify)
  • Group: Layout
  • Children: Yes: any component or text
  • Positional arguments: none

Props

Prop Type How to write it Notes
gap none · xs · sm · md · lg · xl named: gap:… Also accepts small, medium, large.
align start · center · end · stretch · between named: align:…
justify start · center · end · between · around named: justify:…

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({ Stack: MyStack });
<GistUI library={lib} stream={response.body} />;
<GistUI :source="answer" :components="{ Stack: MyStack }" />
<GistUI source={answer} components={{ Stack: MyStack }} />
<GistUI source={answer()} components={{ Stack: MyStack }} />
import { ui } from "@gistui/vanilla/ui";

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

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

Navigation

Type to search…

↑↓ navigate↵ selectEsc close