Preview
Loading preview…
root = Grid(Source("World Population Prospects", "https://population.un.org/wpp/", site:"United Nations"), Source("Population growth", "https://ourworldindata.org/population-growth", site:"Our World in Data"), cols:2)Signature
This is the line a model reads in the system prompt.
Source(title, url, site:str, icon:Icon2, image:str)- Group: Content
- Children: No
- Positional arguments:
title,url(a trailing?means it may be left out)
Props
| Prop | Type | How to write it | Notes |
|---|---|---|---|
title |
string | positional, required | |
url |
string | positional, required | |
site |
string | named: site:… |
|
icon |
name (open list) | named: icon:… |
Also accepts money, revenue, price, cost, payment, chart, analytics, trend, growth, decline, people, team, customers, person, company, office, location, place, travel, flight, food, restaurant, time, date, email, chat, security, idea, ai, launch, speed, energy, warning, error, success, video, movie, streaming, game, education, nature, health, legal, document, photo, shop, shopping, house, storage, api, winner, goal, sunny, clear, cloudy, partly-cloudy, rain, rainy, snow, storm, thunder, temperature, takeoff, departure, landing, arrival, baggage, seat, bag. |
image |
string (URL) | named: image:… |
logo URL |
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({ Source: MySource });
<GistUI library={lib} stream={response.body} />;<GistUI :source="answer" :components="{ Source: MySource }" /><GistUI source={answer} components={{ Source: MySource }} /><GistUI source={answer()} components={{ Source: MySource }} />import { ui } from "@gistui/vanilla/ui";
const lib = ui.extend({ Source: (ctx) => ({ el: myElement(ctx) }) });See Custom components for the full contract. Style hook: [data-gistui="Source"].