Skip to content
Agent UI
BlocksOpenUIConversation

OpenUI Conversation

Use the official @openuidev/react-lang Renderer with a createLibrary result to render structured assistant messages. The host application owns model transport, tool permissions and action authorization.

OpenUIConversation ships with a full API table, a copyable example, and accessibility notes.

tsx
Conversations
What is Agent UI?
Sent

Renderer adapter preview

A UI library for building AI agent interfaces with React.

Connect the official OpenUI Renderer to render real OpenUI Lang.

Sent

Installation

Install the package once, then import OpenUIConversation from its direct entry point or from the root.

bash
pnpm add @agent-ui/react
tsx
import { OpenUIConversation } from "@agent-ui/react/blocks/openui-conversation";

Tailwind CSS v4 users: add @source "../node_modules/@agent-ui/react/src" to the global stylesheet so the library utilities are generated.

Usage

The example below is the same code that renders the preview. Copy it, swap in your own handlers, and ship.

tsx
import { OpenUIConversation } from "@agent-ui/react";
import { Renderer } from "@openuidev/react-lang";
 
<OpenUIConversation messages={messages} renderer={Renderer} library={library} />

API reference

Every prop OpenUIConversation accepts, its type, default, and behaviour.

API reference for this component
NameTypeDefaultDescription
messagesChatMessage[]—Conversation history.
rendererReact.ComponentType<OpenUIRendererProps>—Official OpenUI Renderer.
libraryLibrary—Registered OpenUI component library.
onOpenUIActioncallback—Allowlisted custom and built-in action handler.
toolProviderprovider—Authorized query or mutation tools.
isStreamingboolean—Current message streaming state.

Accessibility

Conversation shell retains semantic message log and native controls. Generated components must independently meet keyboard and screen-reader requirements.
Use it with the rest of the library

OpenUIConversation composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.

4 lines · copy-ready