Preview
Loading preview…
root = Table(signups, sort, search, tags:["Plan", "Status"], pageSize:4)
signups = |Company|Plan|MRR:n|Status
|Lumen Labs|Pro|1200|Active
|Brightwave|Enterprise|9800|Onboarding
|Kite & Co|Starter|240|Active
|Parallax|Pro|1650|Active
|Orbital|Business|4300|At risk
|Northwind|Starter|180|ActiveSignature
This is the line a model reads in the system prompt.
Table(data:data, pageSize:num, sortable:[str], order:str, filter:[str], tags:[str], sort, search, striped)- Group: Data
- Children: No
- Positional arguments:
data(a trailing?means it may be left out)
Props
| Prop | Type | How to write it | Notes |
|---|---|---|---|
data |
table | positional, required | |
pageSize |
number | named: pageSize:… |
rows per page, max 200; 0 = one page |
sort |
flag | bare word: sort |
every column sortable |
sortable |
list of string | named: sortable:… |
only these columns sortable |
order |
string | named: order:… |
initial sort: “Col” or “-Col” (descending) |
search |
flag | bare word: search |
search box |
filter |
list of string | named: filter:… |
columns with filter chips |
tags |
list of string | named: tags:… |
columns shown as tags |
striped |
flag | bare word: striped |
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({ Table: MyTable });
<GistUI library={lib} stream={response.body} />;<GistUI :source="answer" :components="{ Table: MyTable }" /><GistUI source={answer} components={{ Table: MyTable }} /><GistUI source={answer()} components={{ Table: MyTable }} />import { ui } from "@gistui/vanilla/ui";
const lib = ui.extend({ Table: (ctx) => ({ el: myElement(ctx) }) });See Custom components for the full contract. Style hook: [data-gistui="Table"].