What Is Ant Design X and How Does It Build AI Interfaces?

Ant Design X assistant interface with conversations list, message bubbles, thought chain and sender input

Ant Design X is a React UI library for building AI-driven interfaces on top of the Ant Design system. It supplies conversation-focused components such as message bubbles, input senders and conversation lists, along with tools for connecting models and streaming responses. Teams use it to create assistants and copilots without designing chat UI from scratch.

Version 2 of Ant Design X was released alongside antd 6, and the project now spans several packages. The sections below explain the design thinking behind it, the main components, the supporting packages and how to add it to a React application.

The RICH Design Paradigm

Ant Design X is organized around a design approach the team calls RICH, standing for Role, Intention, Conversation and Hybrid UI. The idea is that AI products blend natural language with graphical controls, so components should support both clearly.

  • Role: how the assistant presents itself and sets expectations.
  • Intention: helping users express goals through prompts and suggestions.
  • Conversation: displaying messages, reasoning and results clearly.
  • Hybrid UI: mixing chat with cards, tables and actions.

Core Components

Components map to different stages of an AI interaction, from welcoming a user to showing the reasoning behind an answer. Most screens combine a handful of them.

ComponentRole in the interface
Bubble and Bubble.ListRender user and assistant messages
SenderInput box for prompts, with attachments and actions
ConversationsSidebar list of chat sessions
Welcome and PromptsOnboarding screen and suggested questions
ThoughtChain and ThinkShow steps or reasoning while the model works
ActionsCopy, retry and feedback buttons under messages

Packages in the Ecosystem

Beyond UI components, Ant Design X provides packages for the data side of AI products. Splitting them lets teams adopt only the parts they need.

  • @ant-design/x contains the interface components.
  • @ant-design/x-sdk manages model and agent integration and data streams.
  • @ant-design/x-markdown renders streaming markdown inside messages.
  • @ant-design/x-card renders dynamic cards from structured agent messages.
  • @ant-design/x-skill offers agent skills for building with the library.

Installing Ant Design X

Install the package with npm, yarn or pnpm in a React project that already uses antd. The library extends antd, so the two share theming and visual language.

npm install @ant-design/x

When your app uses ConfigProvider, the documentation recommends replacing it with XProvider, which carries the same configuration plus settings for X components.

A Minimal Chat Screen

A basic assistant needs a message list and an input. The snippet below renders two messages and a sender, which you then connect to your model through the SDK or your own request logic.

import { Bubble, Sender } from '@ant-design/x';

const items = [
  { key: '1', role: 'user', content: 'Hello, Ant Design X!' },
  { key: '2', role: 'ai', content: 'Hello! How can I help?' },
];

export default () => (
  <>
    <Bubble.List items={items} />
    <Sender onSubmit={(text) => console.log(text)} />
  </>
);

Security and Production Tips

Never expose model API keys in browser code for public applications. Route requests through your own server, which can authenticate users, apply rate limits and log usage safely.

Streaming responses improve perceived speed, but they also require careful state handling. Show loading and error states, let users stop generation and keep conversation history manageable so long sessions stay responsive. The skill article covers agent-assisted development with X.

Designing the Welcome Experience

The first screen of an assistant shapes how people use it. The Welcome component introduces the assistant's purpose, and Prompts offers suggested starting points so users do not face an empty input with no idea what to ask.

Good suggestions are specific to the product. An internal analytics assistant might offer report summaries, while a support assistant could suggest order lookups. Clear starting points set expectations and reduce vague questions.

  • Explain what the assistant can and cannot do.
  • Offer three to five focused prompt suggestions.
  • Show recent conversations for returning users.

Showing Progress and Reasoning

AI responses can take time, especially when tools or document searches are involved. ThoughtChain displays steps as they happen, such as reading a file or calling a service, which reassures users that work is in progress.

Transparency also builds trust. When users can see which sources or steps led to an answer, they judge its reliability more easily. The Sources component supports this by listing references beside a response.

Rendering Rich Answers

Assistant replies often contain lists, tables and code. X Markdown renders markdown progressively as tokens stream in, avoiding the flicker of re-rendering the whole message. Code blocks and diagrams can be handled through dedicated components such as CodeHighlighter and Mermaid.

For interactive results, X Card renders cards described by structured messages from an agent. That turns an answer into something actionable, such as a form to confirm a booking or a card summarizing an order.

Theming with antd Tokens

Because the library builds on antd, theme tokens apply to X components as well. A brand color set through XProvider flows into bubbles, buttons and the sender, keeping the assistant consistent with the rest of your application.

Managing Conversations and State

Real assistants keep many conversations, each with its own history. The Conversations component lists them, supports grouping and menus for renaming or deleting, and works with your storage layer to restore earlier sessions.

X SDK utilities help manage messages, loading flags and streamed chunks, so components stay simple views of serializable data. Keeping messages as plain objects also makes it easier to save history, replay sessions and test behaviour.

  • Store messages as serializable objects.
  • Separate request logic from display components.
  • Persist conversations so users can return later.

When to Choose Ant Design X

It suits React teams already using antd who need an assistant, copilot or agent interface. Projects without React, or those needing a single small chat widget, may find a lighter custom component sufficient instead. A short prototype tested with real users is the quickest way to decide.

Conclusion

Ant Design X gives React teams a structured way to build AI assistants: RICH design thinking, components such as Bubble and Sender, and packages for streaming data, markdown and dynamic cards. Install it beside antd, use XProvider for configuration and keep secrets on the server.

Start with Bubble, Sender and Conversations, then add prompts, reasoning displays and rich rendering as your assistant matures. Pairing these components with careful server-side request handling gives users a responsive, trustworthy assistant that feels like a natural part of your product.