Choose a chat UI
Compare the chat UIs that can render OpenUI Lang and pick one for your agent.
The chat UI has two jobs in an OpenUI agent:
- Render responses. Pass the streamed OpenUI Lang to the renderer instead of a Markdown renderer.
- Send actions back. When the user clicks a button or submits a form in a generated interface, send it to the agent as a new user turn.
Everything else, such as the message list, the composer, threads, and the transport, works as it did before. Use OpenUI's own chat UI, or keep the one you have.
Compare the options
| Agent Interface | assistant-ui | CopilotKit | Custom chat UI | |
|---|---|---|---|---|
| You start with | No chat UI | An assistant-ui chat | A CopilotKit chat | A chat you built yourself |
| What OpenUI adds | The whole chat UI | The assistant message's text part | The assistant message's Markdown renderer | The assistant message component |
| Actions | Built in | onAction with useAui() | onAction with useAgent() | onAction with your send function |
| Threads and history | Built in, with a storage adapter for your backend | assistant-ui's runtime | CopilotKit's runtime | Yours |
| Tool activity | Built in | assistant-ui's tool UIs | CopilotKit's tool rendering | Yours |
| Best when | You want a complete chat UI and don't have one yet | You already use assistant-ui | You already use CopilotKit | You own the chat UI and want full control |
If you're starting a new chat UI, use Agent Interface. If you already have one, keep it: adding OpenUI changes a single component.
What every chat UI needs
Whichever chat UI you pick, these pieces come up:
- The same component library as the agent. Import
libraryfrom the file created in Set up UI generation, so the renderer knows every component the agent can write. - The component styles. Import
@openuidev/react-ui/styles/index.cssonce when using the built-in components. isStreaming. Keep it true until the response stream closes, so the interface builds up as lines arrive.onAction. Sendcontinue_conversationevents back as a user turn with the form values, and openopen_urlevents in a new tab. See Conversation history.toolProvider(optional). Pass it when generated interfaces load live data withQuery(). See Tools.
Agent Interface handles streaming and actions for you; pass it the library through its componentLibrary prop. The other guides show each piece in that chat UI's own API.
Guides
Agent Interface
OpenUI's complete React chat UI, with threads, streaming, tool activity, and actions built in.
assistant-ui
Keep assistant-ui in charge of the conversation while OpenUI renders the assistant's responses.
CopilotKit
Add OpenUI rendering to an application whose chat is built with CopilotKit.
Custom chat UI
Connect an existing message list and composer directly to the OpenUI renderer.