logoAnt Design X

DesignDevelopmentComponentsPlayground
  • Ant Design X of React
  • Changelog
    v1.2.0
  • Basic Usage
    • Usage with create-react-app
    • Usage with Vite
    • Usage with Next.js
    • Usage with Umi
    • Usage with Rsbuild
  • Model Integration
    • OpenAI
      Updated
    • Qwen
      Updated
    • Others
  • Other
    • Contributing
    • dangerouslyApiKey Explanation
    • FAQ

Usage with Rsbuild

Resources

Ant Design
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

Here’s the translation of your guide on using @ant-design/x with Rsbuild:


Rsbuild is a build tool powered by Rspack. This article will guide you on how to create a project using Rsbuild and integrate @ant-design/x.

Installation and Initialization

Before you start, you might need to install yarn, pnpm, or bun.

npm iconnpm
yarn iconyarn
pnpm iconpnpm
Bun LogoBun
bash
$ npm create rsbuild

During initialization, create-rsbuild provides a range of templates to choose from. Here, we’ll select the React template.

The tool will automatically initialize a scaffold and install necessary dependencies for a React project. If you encounter network issues during the process, try configuring a proxy or using another npm registry.

Next, navigate to the project directory and start the development server.

bash
$ cd demo
$ npm run dev

Visit http://localhost:3000 in your browser, and seeing the Rsbuild with React interface means the setup is successful.

Importing @ant-design/x

Now, install and import @ant-design/x using yarn, npm, pnpm, or bun.

npm iconnpm
yarn iconyarn
pnpm iconpnpm
Bun LogoBun
bash
$ npm install @ant-design/x --save

Modify src/App.tsx to import the Bubble component from @ant-design/x.

tsx
import React from 'react';
import { Bubble } from '@ant-design/x';
const App: React.FC = () => (
<div className="App">
<Bubble content="Hello world!" />
</div>
);
export default App;

You should now see the Bubble component from @ant-design/x on your page. You can proceed to use other components to develop your application. For other development processes, refer to the official Rsbuild documentation.

Customizing Theme

Refer to Customizing Theme for theme configuration through ConfigProvider:

tsx
import React from 'react';
import { XProvider } from '@ant-design/x';
const App: React.FC = () => (
<XProvider theme={{ token: { colorPrimary: '#00b96b' } }}>
<MyApp />
</XProvider>
);
export default App;

You have successfully integrated @ant-design/x components using Rsbuild. Start developing your application!