Most agent responses are plain text or markdown. That works for short answers, but when the agent needs to present a dashboard, a comparison table, a form for the user to fill, or a multi-section report — markdown falls short. Users end up reading walls of text when a chart or a set of cards would communicate the same information in seconds. Generative UI lets the agent respond with structured UI components — charts, tables, cards, forms, tabs, and more — that your client renders as a real interface. The agent writes OpenUI Lang inside its response, and your client’s renderer turns it into interactive React components in real time as the response streams.Documentation Index
Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
Use this file to discover all available pages before exploring further.
What is OpenUI?
OpenUI is an open standard for generative UI. It provides:- OpenUI Lang — A compact, streaming-first language for describing UI. Up to 67% more token-efficient than equivalent JSON.
- Component libraries — Built-in charts, tables, forms, layouts, cards, and more — ready to use or extend with your own design system.
- Streaming renderer — Parses and renders UI progressively in React as tokens arrive.
- Safe by default — No arbitrary code execution. The agent can only use components you’ve registered.
openui fenced blocks inside its normal assistant messages, and your client renders them with the OpenUI React renderer.
How it works
Generative UI is not a separate tool call. The agent writes OpenUI Lang directly in the assistant response, and the client detects and renders it. The stream uses normalagent.message events. The only difference is that some message content contains an ```openui fenced block that the client can extract and render.
When to use Generative UI
Use Generative UI when the response benefits from visual structure:- Dashboards — Metrics, trends, comparisons across models, services, or time periods.
- Tables — Structured data that users need to scan, sort, or compare quickly.
- Cards and layouts — Summary panels, KPI highlights, or multi-section reports.
- Forms — Inputs, dropdowns, or selections that guide the user’s next action.
- Charts — Bar charts, line charts, or other visualizations that convey patterns faster than numbers in prose.
When not to use Generative UI
Do not use Generative UI for simple answers where markdown is enough — a short explanation, a bullet list, or a code block. The overhead of structured UI is not worth it for small tasks. Generative UI is also not a replacement for server-side actions. If a UI button triggers a follow-up instruction, the client should send that back as a normal user message in the next turn.Available components
The OpenUI built-in library includes components for common patterns:| Category | Components |
|---|---|
| Layout | Stack, Card, Tabs, Accordion |
| Text | TextContent, Markdown |
| Data | Table, Col |
| Charts | BarChart, LineChart, PieChart, Series |
| Input | TextInput, Select, Button, Form |
| Media | Image, Link |
defineComponent and createLibrary from @openuidev/react-lang. The agent will only use components that are registered in the library — it cannot generate arbitrary HTML or code.
Example
User
Show me a dashboard comparing request volume and error rate across my three production models.
Assistant
I will summarize the model traffic visually.The highest traffic is on
gpt-4.1, while llama-3.1 has the highest error rate despite lower volume.