🎯 Skill Positioning
This skill covers all UI components in @ant-design/x — the React component library for building AI-driven chat interfaces based on the RICH interaction paradigm.
It covers component selection, API usage, composition patterns, and common anti-patterns.
Prerequisite: This skill handles UI only. For data flow and streaming, see use-x-chat, x-chat-provider, x-request skills.
Table of Contents
📦 Package Overview
| Package |
Responsibility |
@ant-design/x |
All UI components in this skill |
@ant-design/x-sdk |
Data providers, request, streaming state — not covered here |
@ant-design/x-markdown |
Markdown rendering inside Bubble — see x-markdown skill |
npm install @ant-design/x
@ant-design/x extends antd. If you use ConfigProvider, replace it with XProvider.
🗂️ Component Groups
Based on the RICH interaction paradigm:
| Stage |
Components |
| General |
Bubble, Bubble.List, Conversations, Notification |
| Wake |
Welcome, Prompts |
| Express |
Sender, Attachments, Suggestion |
| Confirmation |
Think, ThoughtChain |
| Feedback |
Actions, FileCard, Sources, CodeHighlighter, Mermaid, Folder |
| Global |
XProvider |
🚀 Quick Start Decision Guide
| If you need to... |
Read first |
| Render a chat message bubble |
COMPONENTS.md → Bubble |
| Build a chat input box |
COMPONENTS.md → Sender |
| List and switch conversations |
COMPONENTS.md → Conversations |
| Show AI thinking process |
COMPONENTS.md → ThoughtChain / Think |
| Add action buttons below a message |
COMPONENTS.md → Actions |
| Build a welcome / onboarding screen |
COMPONENTS.md → Welcome + Prompts |
| Show file attachments in input |
COMPONENTS.md → Attachments |
| Show source citations |
COMPONENTS.md → Sources |
| Add quick command suggestions |
COMPONENTS.md → Suggestion |
| Display a hierarchical file/folder tree |
COMPONENTS.md → Folder |
| Wire a complete chat page |
PATTERNS.md |
| Look up a specific prop |
API.md |
🛠 Recommended Workflow
- Pick components from COMPONENTS.md for each interaction stage.
- Use PATTERNS.md to understand how components compose into full pages.
- Wrap the app root with
XProvider (replaces antd's ConfigProvider) for locale, theme, and shortcut keys.
- Use API.md for precise prop names — do not guess them.
Minimal Full-Page Example
import { XProvider, Welcome, Prompts, Bubble, Sender } from '@ant-design/x';
export default () => (
<XProvider>
<Welcome title="Hello!" description="How can I help you?" />
<Prompts
items={[{ key: '1', label: 'What can you do?' }]}
=> console.log(info.data.label)}
/>
<Bubble.List items={[{ key: '1', content: 'Hello World', placement: 'end' }]} />
<Sender => console.log(msg)} />
</XProvider>
);
🚨 Development Rules
- Always use
XProvider at the app root — it supersedes antd's ConfigProvider and enables locale, direction, and x-specific shortcut keys.
Bubble.List not Bubble in loops — Bubble.List handles scroll anchoring, auto-scroll, and role-based layout; mapping Bubble manually loses these.
- Keep
components prop stable in Bubble and Bubble.List — inline object creation causes re-renders and resets typing animations.
- Set
streaming={true} during stream, streaming={false} on final chunk — leaving it true permanently breaks the done state.
ThoughtChain vs Think: use ThoughtChain for multi-step tool/agent call chains; use Think for a collapsible single-block reasoning display.
Actions.Copy, Actions.Feedback, Actions.Audio are preset sub-components — prefer them over building custom equivalents.
- Sender
onSubmit vs onChange: onSubmit fires on send button or Enter key; onChange fires on every keystroke — do not conflate them.
- Never render
Mermaid or CodeHighlighter inside a Bubble content string — use contentRender or the components map instead.
🤝 Skill Collaboration
| Scenario |
Skill combination |
| Full AI chat app |
x-chat-provider → x-request → use-x-chat → x-components → x-markdown |
| Just building UI structure |
x-components only |
| Markdown in bubble replies |
x-components + x-markdown |
| Streaming data flow only |
use-x-chat + x-request |
🔗 Reference Resources
- COMPONENTS.md — Component-by-component guide with usage, key props, and examples
- PATTERNS.md — Full-page composition patterns and integration recipes
- API.md — Auto-generated prop reference from official component docs — covers all 17 components
Official Documentation
1---2name: x-components3description: Use when building AI chat UIs with @ant-design/x components — covers Bubble, Sender, Conversations, Prompts, ThoughtChain, Actions, Welcome, Attachments, Sources, Suggestion, Think, FileCard, CodeHighlighter, Mermaid, Folder, XProvider, and Notification.4---56# 🎯 Skill Positioning78**This skill covers all UI components in `@ant-design/x`** — the React component library for building AI-driven chat interfaces based on the RICH interaction paradigm.910It covers component selection, API usage, composition patterns, and common anti-patterns.1112> **Prerequisite**: This skill handles UI only. For data flow and streaming, see `use-x-chat`, `x-chat-provider`, `x-request` skills.1314## Table of Contents1516- [📦 Package Overview](#-package-overview)17- [🗂️ Component Groups](#-component-groups)18- [🚀 Quick Start Decision Guide](#-quick-start-decision-guide)19- [🛠 Recommended Workflow](#-recommended-workflow)20- [🚨 Development Rules](#-development-rules)21- [🤝 Skill Collaboration](#-skill-collaboration)22- [🔗 Reference Resources](#-reference-resources)2324# 📦 Package Overview2526| Package | Responsibility |27| ------------------------ | ----------------------------------------------------------- |28| `@ant-design/x` | All UI components in this skill |29| `@ant-design/x-sdk` | Data providers, request, streaming state — not covered here |30| `@ant-design/x-markdown` | Markdown rendering inside Bubble — see `x-markdown` skill |3132```bash33npm install @ant-design/x34```3536> `@ant-design/x` extends `antd`. If you use `ConfigProvider`, replace it with `XProvider`.3738# 🗂️ Component Groups3940Based on the RICH interaction paradigm:4142| Stage | Components |43| ---------------- | ------------------------------------------------------------------------ |44| **General** | `Bubble`, `Bubble.List`, `Conversations`, `Notification` |45| **Wake** | `Welcome`, `Prompts` |46| **Express** | `Sender`, `Attachments`, `Suggestion` |47| **Confirmation** | `Think`, `ThoughtChain` |48| **Feedback** | `Actions`, `FileCard`, `Sources`, `CodeHighlighter`, `Mermaid`, `Folder` |49| **Global** | `XProvider` |5051# 🚀 Quick Start Decision Guide5253| If you need to... | Read first |54| --- | --- |55| Render a chat message bubble | [COMPONENTS.md → Bubble](reference/COMPONENTS.md#bubble) |56| Build a chat input box | [COMPONENTS.md → Sender](reference/COMPONENTS.md#sender) |57| List and switch conversations | [COMPONENTS.md → Conversations](reference/COMPONENTS.md#conversations) |58| Show AI thinking process | [COMPONENTS.md → ThoughtChain / Think](reference/COMPONENTS.md#thoughtchain--think) |59| Add action buttons below a message | [COMPONENTS.md → Actions](reference/COMPONENTS.md#actions) |60| Build a welcome / onboarding screen | [COMPONENTS.md → Welcome + Prompts](reference/COMPONENTS.md#welcome--prompts) |61| Show file attachments in input | [COMPONENTS.md → Attachments](reference/COMPONENTS.md#attachments) |62| Show source citations | [COMPONENTS.md → Sources](reference/COMPONENTS.md#sources) |63| Add quick command suggestions | [COMPONENTS.md → Suggestion](reference/COMPONENTS.md#suggestion) |64| Display a hierarchical file/folder tree | [COMPONENTS.md → Folder](reference/COMPONENTS.md#folder) |65| Wire a complete chat page | [PATTERNS.md](reference/PATTERNS.md) |66| Look up a specific prop | [API.md](reference/API.md) |6768# 🛠 Recommended Workflow69701. Pick components from [COMPONENTS.md](reference/COMPONENTS.md) for each interaction stage.712. Use [PATTERNS.md](reference/PATTERNS.md) to understand how components compose into full pages.723. Wrap the app root with `XProvider` (replaces `antd`'s `ConfigProvider`) for locale, theme, and shortcut keys.734. Use [API.md](reference/API.md) for precise prop names — do not guess them.7475## Minimal Full-Page Example7677```tsx78import { XProvider, Welcome, Prompts, Bubble, Sender } from '@ant-design/x';7980export default () => (81 <XProvider>82 <Welcome title="Hello!" description="How can I help you?" />83 <Prompts84 items={[{ key: '1', label: 'What can you do?' }]}85 onItemClick={(info) => console.log(info.data.label)}86 />87 <Bubble.List items={[{ key: '1', content: 'Hello World', placement: 'end' }]} />88 <Sender onSubmit={(msg) => console.log(msg)} />89 </XProvider>90);91```9293# 🚨 Development Rules9495- **Always use `XProvider` at the app root** — it supersedes `antd`'s `ConfigProvider` and enables locale, direction, and x-specific shortcut keys.96- **`Bubble.List` not `Bubble` in loops** — `Bubble.List` handles scroll anchoring, auto-scroll, and role-based layout; mapping `Bubble` manually loses these.97- **Keep `components` prop stable** in `Bubble` and `Bubble.List` — inline object creation causes re-renders and resets typing animations.98- **Set `streaming={true}` during stream, `streaming={false}` on final chunk** — leaving it `true` permanently breaks the done state.99- **`ThoughtChain` vs `Think`**: use `ThoughtChain` for multi-step tool/agent call chains; use `Think` for a collapsible single-block reasoning display.100- **`Actions.Copy`, `Actions.Feedback`, `Actions.Audio`** are preset sub-components — prefer them over building custom equivalents.101- **Sender `onSubmit` vs `onChange`**: `onSubmit` fires on send button or Enter key; `onChange` fires on every keystroke — do not conflate them.102- **Never render `Mermaid` or `CodeHighlighter` inside a `Bubble` `content` string** — use `contentRender` or the `components` map instead.103104# 🤝 Skill Collaboration105106| Scenario | Skill combination |107| --- | --- |108| Full AI chat app | `x-chat-provider` → `x-request` → `use-x-chat` → `x-components` → `x-markdown` |109| Just building UI structure | `x-components` only |110| Markdown in bubble replies | `x-components` + `x-markdown` |111| Streaming data flow only | `use-x-chat` + `x-request` |112113# 🔗 Reference Resources114115- [COMPONENTS.md](reference/COMPONENTS.md) — Component-by-component guide with usage, key props, and examples116- [PATTERNS.md](reference/PATTERNS.md) — Full-page composition patterns and integration recipes117- [API.md](reference/API.md) — Auto-generated prop reference from official component docs — covers all 17 components118119## Official Documentation120121- [Ant Design X Overview](https://github.com/ant-design/x/blob/main/packages/x/components/overview/index.en-US.md)122- [Bubble](https://github.com/ant-design/x/blob/main/packages/x/components/bubble/index.en-US.md)123- [Sender](https://github.com/ant-design/x/blob/main/packages/x/components/sender/index.en-US.md)124- [Conversations](https://github.com/ant-design/x/blob/main/packages/x/components/conversations/index.en-US.md)125- [ThoughtChain](https://github.com/ant-design/x/blob/main/packages/x/components/thought-chain/index.en-US.md)126- [Actions](https://github.com/ant-design/x/blob/main/packages/x/components/actions/index.en-US.md)127- [Welcome](https://github.com/ant-design/x/blob/main/packages/x/components/welcome/index.en-US.md)128- [Prompts](https://github.com/ant-design/x/blob/main/packages/x/components/prompts/index.en-US.md)129- [Attachments](https://github.com/ant-design/x/blob/main/packages/x/components/attachments/index.en-US.md)130- [Sources](https://github.com/ant-design/x/blob/main/packages/x/components/sources/index.en-US.md)131- [Suggestion](https://github.com/ant-design/x/blob/main/packages/x/components/suggestion/index.en-US.md)132- [Think](https://github.com/ant-design/x/blob/main/packages/x/components/think/index.en-US.md)133- [Folder](https://github.com/ant-design/x/blob/main/packages/x/components/folder/index.en-US.md)134- [XProvider](https://github.com/ant-design/x/blob/main/packages/x/components/x-provider/index.en-US.md)