Preview
Loading preview…
root = Math("C = \\frac{P \\cdot n}{12} + \\sum_{i=1}^{k} a_i")Signature
This is the line a model reads in the system prompt.
Math(tex, inline)- Group: Content
- Children: No
- Positional arguments:
tex(a trailing?means it may be left out)
Props
| Prop | Type | How to write it | Notes |
|---|---|---|---|
tex |
string | positional, required | |
inline |
flag | bare word: inline |
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({ Math: MyMath });
<GistUI library={lib} stream={response.body} />;<GistUI :source="answer" :components="{ Math: MyMath }" /><GistUI source={answer} components={{ Math: MyMath }} /><GistUI source={answer()} components={{ Math: MyMath }} />import { ui } from "@gistui/vanilla/ui";
const lib = ui.extend({ Math: (ctx) => ({ el: myElement(ctx) }) });See Custom components for the full contract. Style hook: [data-gistui="Math"].