Craft AI-driven interfaces effortlessly
npm install @ant-design/xEasily build AI-driven interfaces.
[![CI status][github-action-image]][github-action-url] [![codecov][codecov-image]][codecov-url] [![NPM version][npm-image]][npm-url]
[![NPM downloads][download-image]][download-url] [![][bundlephobia-image]][bundlephobia-url] [![antd][antd-image]][antd-url] [![Follow zhihu][zhihu-image]][zhihu-url]
Changelog · [Report a Bug][github-issues-bug-report] · [Feature Request][github-issues-feature-request] · 中文 · English
[npm-image]: https://img.shields.io/npm/v/@ant-design/x.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@ant-design/x
[github-action-image]: https://github.com/ant-design/x/actions/workflows/main.yml/badge.svg
[github-action-url]: https://github.com/ant-design/x/actions/workflows/main.yml
[codecov-image]: https://codecov.io/gh/ant-design/x/graph/badge.svg?token=wrCCsyTmdi
[codecov-url]: https://codecov.io/gh/ant-design/x
[download-image]: https://img.shields.io/npm/dm/@ant-design/x.svg?style=flat-square
[download-url]: https://npmjs.org/package/@ant-design/x
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@ant-design/x?style=flat-square
[bundlephobia-url]: https://bundlephobia.com/package/@ant-design/x
[github-issues-bug-report]: https://github.com/ant-design/x/issues/new?template=bug-report.yml
[github-issues-feature-request]: https://github.com/ant-design/x/issues/new?template=bug-feature-request.yml
[antd-image]: https://img.shields.io/badge/-Ant%20Design-blue?labelColor=black&logo=antdesign&style=flat-square
[antd-url]: https://ant.design
[zhihu-image]: https://img.shields.io/badge/-Ant%20Design-white?logo=zhihu
[zhihu-url]: https://www.zhihu.com/column/c_1564262000561106944
- 🌈 Best practices from enterprise-level AI products: Based on RICH interaction paradigms, providing excellent AI interaction experience
- 🧩 Flexible atomic components: Covering most AI scenarios, helping you quickly build personalized AI interaction pages
- ✨ Stream-friendly, extensible, and high-performance Markdown renderer: Supports streaming formulas, code highlighting, mermaid diagrams, etc. @ant-design/x-markdown
- 🚀 Out-of-the-box model/agent integration: Easily connect to OpenAI-compatible model/agent services @ant-design/x-sdk
- ⚡️ Efficient management of large model data streams: Provides handy data stream management features for more efficient development @ant-design/x-sdk
- 📦 Rich template support: Multiple templates for quick LUI app development Templates
- 🛡 Full TypeScript coverage: Developed with TypeScript, providing complete type support for better experience and reliability
- 🎨 Deep theme customization: Fine-grained style adjustments for personalized needs in various scenarios
``bash`
npm install @ant-design/x
`bash`
yarn add @ant-design/x
`bash`
pnpm add @ant-design/x
`bash`
ut install @ant-design/x
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.
> Strongly not recommended to use built files as they do not support on-demand loading and may not get quick bug fixes for underlying dependencies.
> Note: antdx.js and antdx.min.js depend on react, react-dom, dayjs, antd, @ant-design/cssinjs, and @ant-design/icons. Please make sure to import these files first.
Based on the RICH interaction paradigm, we provide many atomic components for different interaction stages to help you flexibly build your AI application:
- Component Overview
- Templates
Here is a simple example of building a dialog using atomic components:
`tsx
import React from 'react';
import {
// Message bubble
Bubble,
// Sender box
Sender,
} from '@ant-design/x';
const messages = [
{
key: 'message_1',
content: 'Hello, Ant Design X!',
role: 'user',
},
{
key: 'x_message_1',
content: 'Hello, I am Ant Design X!',
role: 'x',
},
];
const role = {
// Bubble position: end
x: {
placement: 'end',
},
};
const App = () => (
export default App;
`
@ant-design/x-sdk provides a series of tool APIs for out-of-the-box management of AI application data streams. See details here.
@ant-design/x-markdown aims to provide a stream-friendly, extensible, and high-performance Markdown renderer. Supports streaming formulas, code highlighting, mermaid diagrams, etc. See details here.
@ant-design/x supports tree shaking based on ES modules by default.
@ant-design/x is written in TypeScript and provides complete definition files.
Ant Design X is widely used in AI-driven user interfaces within Ant Group. If your company or product uses Ant Design X, feel free to leave a message here.
> antx uses npm-workspace to organize code. It is recommended to use npm or utoo for local development.
`bashInstall utoo
$ npm i -g utoo
How to Contribute
Before participating in any form, please read the Contributor Guide. If you wish to contribute, feel free to submit a Pull Request or Report a Bug.
> Highly recommended reading How To Ask Questions The Smart Way, How to Ask Questions in Open Source Community, How to Report Bugs Effectively, and How to Submit Unsolvable Issues to Open Source Projects for better help.
Community Support
If you encounter problems during use, you can seek help through the following channels. We also encourage experienced users to help newcomers through these channels.
When asking questions in GitHub Discussions, please use the
Q&A` label.