# Generative UI

> How CopilotKit lets agents drive UI. Learn the primitives it ships, what each one is for, and how to pick the right one.

Generative UI lets your agent decide what appears on the screen. The agent can render a component you built, compose a layout from a catalog, or embed sandboxed UI from an MCP server.

## What CopilotKit ships [#what-copilotkit-ships]

Seven primitives. Each one solves a different problem.

| Primitive | What it does |
|---|---|
| **[Components as Tools](/react-native/ms-agent-harness-dotnet/generative-ui/tool-based)** | Register an application component as a frontend tool; the agent calls it and CopilotKit renders it inline with typed inputs. |
| **[Tool Call Rendering](/react-native/ms-agent-harness-dotnet/generative-ui/tool-rendering)** | Map your agent's existing backend tool calls to custom UI cards showing live status, arguments, and results. |
| **[State Rendering](/react-native/ms-agent-harness-dotnet/generative-ui/state-rendering)** | Subscribe to the agent's streamed state and re-render UI as values arrive. |
| **[Reasoning](/generative-ui/reasoning)** | Render the model's reasoning tokens inline as a first-class message type (default card, or fully custom). |
| **[A2UI](/generative-ui/a2ui)** | Render UI from a declarative schema the agent emits, composed against a catalog you register. Two flavors: [Dynamic Schema](/generative-ui/a2ui/dynamic-schema) (LLM generates the schema) and [Fixed Schema](/generative-ui/a2ui/fixed-schema) (you author the schema, agent supplies data). |
| **[MCP Apps](/generative-ui/mcp-apps)** | Embed UI that an MCP server ships alongside its tools, rendered in a sandboxed iframe. No frontend renderer required. |
| **[Open Generative UI](/generative-ui/open-generative-ui)** | The agent generates sandboxed HTML, CSS, and JavaScript that streams live into the chat. |

## Pick one [#pick-one]

Match the row that sounds like your situation:

| You want to… | Use |
|---|---|
| Let the agent render a specific application component you've already built | **[Components as Tools](/react-native/ms-agent-harness-dotnet/generative-ui/tool-based)** |
| Brand the cards CopilotKit draws for your agent's existing backend tools | **[Tool Call Rendering](/react-native/ms-agent-harness-dotnet/generative-ui/tool-rendering)** |
| Update UI as the agent's state changes (progress, drafts, dashboards) | **[State Rendering](/react-native/ms-agent-harness-dotnet/generative-ui/state-rendering)** |
| Surface the model's thinking chain in the chat | **[Reasoning](/generative-ui/reasoning)** |
| Let the agent compose layouts from a catalog you define | **[A2UI](/generative-ui/a2ui)**: [Fixed Schema](/generative-ui/a2ui/fixed-schema) if the surface is known, [Dynamic Schema](/generative-ui/a2ui/dynamic-schema) if it isn't |
| Embed someone else's MCP-hosted UI in the chat | **[MCP Apps](/generative-ui/mcp-apps)** |
| Let the agent generate a complete interactive UI in the chat | **[Open Generative UI](/generative-ui/open-generative-ui)** |

## How the primitives compare [#how-the-primitives-compare]

These primitives sit along a spectrum from author-controlled to
agent-invented. All of them use the same frontend, runtime, and AG-UI protocol,
so you can choose a different primitive for each feature.

- **Controlled**: you wrote the component; the agent only picks *which* one to render and *what data* to pass. Highest predictability, highest engineering cost per capability. *Components as Tools, Tool Call Rendering, State Rendering, Reasoning.*
- **Declarative**: the agent emits a structured spec; the frontend composes from a catalog you registered. Creativity inside a guardrail. *A2UI (Dynamic and Fixed Schema).*
- **Open-Ended**: the UI is invented outside your app (by an MCP server or by the agent) and you sandbox it. Highest expressive range, hardest to guarantee accessibility / brand / security. *MCP Apps, Open Generative UI.*
