Topic 5 of 5 · 5 min read
Generative UI and interactive apps in chat
Goal: Decide when a response should render as a component rather than text, and list the checks a generated component must pass before display.
Generative UI means the AI chooses an interface component, such as a table, a form or a chart, instead of replying in plain text; it earns its place when the user needs to scan, compare or act, and it must pass checks before it is shown. A reply that lists twelve flights in paragraphs is harder to use than a table the user can sort.
Check yourself · 1 of 3
Which request is best answered with a table component rather than text?
Why it matters
Text is flexible but slow to scan. When the answer is a set of items with the same fields, a table is better. When the next step is entering data, a form is better than asking the user to type it in a sentence. Chat products have started to let tools return real interfaces inside the conversation. The Model Context Protocol, an open standard for connecting AI to tools, includes MCP Apps for this: a tool can return an interactive interface that the chat client displays in a sandboxed frame.
When to render a component
- Compare or scan: many items, same fields. Use a table.
- Trend or proportion: numbers over time. Use a chart with labelled axes.
- Collect inputs: several values at once. Use a form with typed fields.
- Take an action: a confirm, cancel or choose step. Use buttons, not "reply yes".
- Otherwise: an explanation, an opinion or a short answer stays as text.
Checks before display
- Allowed components only. The model picks from a fixed list. It does not write arbitrary markup that the client runs.
- Valid data. Fields match a schema; a chart has labels and values of the same length; no empty table.
- Accessible. Text alternatives for charts, labels on every form field, keyboard use, sufficient contrast. The WCAG standard still applies to generated screens.
- Consistent. Same styles, spacing and wording as the rest of the product. Random layouts erode trust.
- Safe actions. A generated button that changes data goes through the same confirmation and permission checks as a normal one.
- Fallback. If the component fails validation, show plain text instead of a broken screen.
Before and after
Before: The assistant answers "Show me last quarter's sales by region" with four paragraphs of numbers. The user copies them into a spreadsheet to compare.
After: The assistant returns a table sorted by revenue and a bar chart with a text summary. Both come from a fixed component list and the chart carries a text alternative.
What goes wrong
- A chart with a missing axis label or mismatched data looks authoritative and misleads.
- Every response looks different, so users cannot learn the product.
- A generated form has fields without labels, so a screen reader cannot use it.
Examples
A validation gate for a generated chart
type BarChart = { labels: string[]; values: number[]; title: string; altText: string };
function canRender(c: BarChart): boolean {
return (
c.labels.length > 0 &&
c.labels.length === c.values.length &&
c.title.trim() !== "" &&
c.altText.trim() !== ""
);
}
// If canRender is false, show the text summary instead.
The check rejects a chart whose labels and values differ in length or that has no text alternative.
Table or text?
"Compare these three phone plans by price, data and contract length" should render as a table: three items, same fields. "Why is my bill higher this month?" should stay as text with a link to the bill, because the answer is an explanation, not a set to scan.
Key points
- Render a component when the user needs to scan, compare, enter several values or take an action; keep explanations as text.
- The model should choose from a fixed list of allowed components rather than produce arbitrary markup.
- MCP Apps let a tool return an interactive interface that a chat client shows in a sandboxed frame.
- Validate data against a schema and fall back to plain text if the component fails.
- Generated components must meet accessibility and consistency standards like any other screen, including labels and text alternatives.
Common mistakes
- Rendering a component for answers that are better explained in words.
- Letting the model output arbitrary markup instead of choosing from allowed components.
- Skipping accessibility checks on generated screens.
- Showing a broken component instead of falling back to plain text.
Check yourself · 2 of 3
What is the purpose of MCP Apps in a chat client?
Check yourself · 3 of 3
A generated chart arrives with five labels and four values. What should the client do?
Practice items, not counted towards your mastery.
Start here
- The Shape of AI: UX patterns for AI design (opens in a new tab)ArticleFree
A browsable catalogue of AI interface patterns, grouped by input, wayfinding, tuners and trust, with real product screenshots.
- AI: First New UI Paradigm in 60 Years (Nielsen Norman Group) (opens in a new tab)ArticleFree
Explains intent-based interaction, where the user states the outcome instead of the steps, and why it shifts the burden onto the user's wording.
- Prompt Controls in GenAI Chatbots (Nielsen Norman Group) (opens in a new tab)ArticleFree
Shows how buttons, menus and parameter controls reduce the effort of writing prompts in chat products.
More for this topic
- MCP Apps overview (opens in a new tab)DocsFree
The official description of how a tool can return an interactive interface that renders inside a chat client.
- Web Content Accessibility Guidelines (WCAG) overview (opens in a new tab)StandardFree
The standard a generated table, form or chart must still meet: text alternatives, keyboard use, contrast and labels.