- Introduction
- Overview
- Common
- Confirmation
- Wake
- Express
- Feedback
- Others
Introduction
@ant-design/x
is a React UI library based on the Ant Design system, designed for AI-driven interfaces. It provides out-of-the-box intelligent conversation components and seamless API integration to help you quickly build smart application interfaces.
We recommend using npm, yarn, pnpm, bun, or utoo for development. This allows easy debugging in development and reliable packaging for production, benefiting from the ecosystem and toolchain.
$ npm install @ant-design/x --save
If your network is unstable, consider using cnpm.
You can use script
and link
tags to directly import files and use the global variable antdx
.
The npm package's dist directory provides antdx.js
, antdx.min.js
, and antdx.min.js.map
.
Not recommended to use built files as they do not support on-demand loading and may not receive quick bug fixes for underlying dependencies.
Note:
antdx.js
andantdx.min.js
depend onreact
,react-dom
,dayjs
,antd
,@ant-design/cssinjs
, and@ant-design/icons
. Please ensure these files are imported first.
Based on the RICH interaction paradigm, we provide a variety of atomic components for different interaction stages to help you flexibly build your AI conversation app:
Bubble
- message bubble, Conversations
- conversation management, Notification
- system notificationWelcome
- welcome, Prompts
- prompt setSender
- input box, Attachment
- input attachment, Suggestion
- quick commandThink
- thinking process, ThoughtChain
- chain of thoughtActions
- action list, FileCard
- file cardXProvider
- global config: theme, locale, etc.Here is a simple example of building a chat box using atomic components:
import React from 'react';import {// Message bubbleBubble,// Input boxSender,} from '@ant-design/x';const messages = [{content: 'Hello, Ant Design X!',role: 'user',key: 'user_0',},];const App = () => (<div><Bubble.List items={messages} /><Sender /></div>);export default App;
With X SDK, you can easily integrate models and agent services, along with useful utilities.
We provide an optimized X Markdown rendering solution for streaming content, with powerful extension capabilities. It supports formulas, code highlighting, mermaid charts, and delivers excellent performance for smooth content display.
@ant-design/x
supports tree shaking based on ES modules by default.
@ant-design/x
is written in TypeScript and provides complete type definitions.