Preview
Loading preview…
root = Slides(Slide(Header("GistUI", "Generative UI, engineered for production", size:xl, align:center), layout:center, bg:inverse), Slide(Header("Why", "Three reasons"), Grid(Tile("Fast", "Each line is parsed once", icon:rocket), Tile("Safe", "Programs cannot run code", icon:shield), Tile("Small", "74 KB first load", icon:sparkles), cols:3)), v:viewer, title:"Launch deck")Signature
This is the line a model reads in the system prompt.
Slides(...Slide, title:str, subtitle:str, v:deck|viewer, ratio:str)- Group: Layout
- Children: Yes: Slide
- Positional arguments: none
Props
| Prop | Type | How to write it | Notes |
|---|---|---|---|
title |
string | named: title:… |
|
subtitle |
string | named: subtitle:… |
|
v |
deck · viewer |
named: v:… |
Default "deck". |
ratio |
string | named: ratio:… |
16:9 (default), 4:3 or auto |
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({ Slides: MySlides });
<GistUI library={lib} stream={response.body} />;<GistUI :source="answer" :components="{ Slides: MySlides }" /><GistUI source={answer} components={{ Slides: MySlides }} /><GistUI source={answer()} components={{ Slides: MySlides }} />import { ui } from "@gistui/vanilla/ui";
const lib = ui.extend({ Slides: (ctx) => ({ el: myElement(ctx) }) });See Custom components for the full contract. Style hook: [data-gistui="Slides"].