How to use ant-design-pro components in ant-design react app?

Viewed 4307

I have created react app with create-react-app and used ant-design components, as the project becomes bigger, I need to use some awesome components from ant-design-pro.

Is there any way to integrate ant-design-pro components in existing ant-design project?

I have tried to import and use @ant-design/pro-layout but didn't work for me.

2 Answers

For V4 refer to Upgrade to V4, check Replace BasicLayout if you use @ant-design/pro-layout.

For single components use npm install ant-design-pro@2.3.2 and import components for your needs:

import Ellipsis from 'ant-design-pro/lib/Ellipsis';

Demo:

Edit OS Q 56488542

Welcome to Stack Overflow!

It seems that the ant-design team chose to integrate ant-design-pro components directly into antd. The version 2.3.0 of ant-design-pro was the latest version of the library that you could use as a component library. (source: their changelog).

You can probably still install that version (here's the documentation to do so).

They recently released the v4 of ant-design-pro and I'm not entirely sure whether you can install the components stand-alone or not.

However, a lot of components from ant-design-pro are now maintained directly inside ant design, as you can see here:

In the next version of Pro, we will gradually remove all the components that will be added to the Ant Design, which are under development:

...

These components will be more fully supported and maintained in Ant Design, and Pro will focus on Layout and scaffolding.

Related