logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
5.25.4
  • Ant Design of React
  • Changelog
    v5.25.4
  • Basic Usage
    • Getting Started
    • Usage with Vite
    • Usage with Next.js
      Updated
    • Usage with Umi
    • Usage with Rsbuild
    • Usage with Farm
    • Usage with Refine
  • Advanced
    • Customize Theme
    • CSS Compatible
    • Server Side Rendering
    • CSS Variables
      New
    • Use custom date library
    • Internationalization
    • Common Props
    • React 19 Compatibility
      New
  • Migration
    • V4 to V5
    • Less variables to Component Token
  • Other
    • Third-Party Libraries
    • Contributing
    • FAQ
Install and Initialization
Import antd
Customize Theme

Usage with Rsbuild

contributors
  • Usage with UmiUsage with Farm

    Resources

    Ant Design X
    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

    Rsbuild is a build tool driven by Rspack. This article will try to use Rsbuild to create a project and import antd.

    Install and Initialization

    Before all start, you may need install yarn or pnpm or bun.

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

    During the initialization process, create-rsbuild provides a series of templates for us to choose, We need choose the React template.

    The tool will create and initialize environment and dependencies automatically, please try config your proxy setting or use another npm registry if any network errors happen during it.

    Then we go inside project and start it.

    bash
    $ cd demo
    $ npm run dev

    Open the browser at http://localhost:3000. It renders a title saying Rsbuild with React on the page, which is considered successful.

    Import antd

    Now we install antd from yarn or npm or pnpm or bun.

    npm iconnpm
    yarn iconyarn
    pnpm iconpnpm
    Bun LogoBun
    bash
    $ npm install antd --save

    Modify src/App.tsx, import Button component from antd.

    tsx
    import React from 'react';
    import { Button } from 'antd';
    const App: React.FC = () => (
    <div className="App">
    <Button type="primary">Button</Button>
    </div>
    );
    export default App;

    OK, you should now see a blue primary button displayed on the page. Next you can choose any components of antd to develop your application. Visit other workflows of Rsbuild at its Official documentation.

    Customize Theme

    Ref to the Customize Theme documentation. Modify theme with ConfigProvider:

    tsx
    import React from 'react';
    import { ConfigProvider } from 'antd';
    const App: React.FC = () => (
    <ConfigProvider theme={{ token: { colorPrimary: '#00b96b' } }}>
    <MyApp />
    </ConfigProvider>
    );
    export default App;

    We are successfully running the antd components using Rsbuild now, let’s start build your own application!