YuhuanStudioYunUIDocs
Chat

Chat

Host-driven chat surfaces — message row, smart-scroll list, responsive header and composer with optional source, command and model menus.

The chat pattern provides message rows, a smart-scrolling list, a controlled composer, and a responsive header. The host supplies messages, execution state, and localized copy. Optionally pass host-owned sourceItems, commandItems, and modelItems to ChatComposer; selection callbacks return stable host ids, and the component does not search, upload, execute a command, or call a model. Markdown message bodies can use @yuhuanowo/yunui/content. The chat API remains on its own subpath, @yuhuanowo/yunui/chat.

Existing message, composer and header props/slots remain available. Consumers can keep their current state and callback wiring; the updated appearance comes from YunUI's public components, so apps do not need to redraw these surfaces or copy their styles.

Install

The chat subpath ships with YunUI. If your chat renders Markdown or other rich content, install the optional content peers and styles described in the Content overview.

bash1 line
pnpm add @yuhuanowo/yunui

Import

tsx6 lines
import {
ChatMessage,
ChatMessageList,
ChatComposer,
ChatHeader,
} from "@yuhuanowo/yunui/chat";

Everything together

The workspace preview composes public ChatHeader, ChatMessageList, ChatMessage, ChatComposer, AgentRunStatus, AgentTimeline, ApprovalQuestion, and MarkdownRenderer exports. Its source/model lists and five agent states are local documentation fixtures; no message or tool request is sent.

Chat workspace

No host callback has run yet.

These controls use local documentation data. Questionnaire answers are separate from tool approval; only Allow or Deny decides the command, and no command is sent or run.

Release reviewAgent Chat · YunUI workspace
Can you check the Navbar docs before the release?
YunUI agent
Ready
I’ll check the Navbar docs in English, Simplified Chinese and Traditional Chinese before the release.
Workspace docs

The pieces

Each block is exported standalone so you can assemble your own layout:

Answer and review units

On this page