OpenUIMessage
Optional official OpenUI renderer host for structured responses. Import from @agent-ui/react or a direct subpath. Tailwind CSS v4 theme tokens are required.
OpenUIMessage ships with a full API table, a copyable example, and accessibility notes.
Renderer adapter preview
A structured UI response would appear here.
Connect the official OpenUI Renderer to render real OpenUI Lang.
Installation
Install the package once, then import OpenUIMessage from its direct entry point or from the root.
pnpm add @agent-ui/reactimport { OpenUIMessage } from "@agent-ui/react/openui-message";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.
import { OpenUIMessage } from "@agent-ui/react"; <OpenUIMessage renderer={Renderer} library={library} response={message} />API reference
Every prop OpenUIMessage accepts, its type, default, and behaviour.
| Name | Type | Default | Description |
|---|---|---|---|
| renderer | React.ComponentType<OpenUIRendererProps> | — | Official OpenUI Renderer component. |
| library | Library | — | Component library created by OpenUI. |
| response | string | null | — | Model's OpenUI Lang response. |
| isStreaming | boolean | — | Configuration exposed through the component's public React props. |
| onAction | callback | — | Configuration exposed through the component's public React props. |
Accessibility
OpenUIMessage composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.
3 lines · copy-ready