React to install and use the component library AntDesign

React framework for the use of project development, the choice of a suitable own UI library is extremely important, antdis a good choice. antdReact UI component library is based on Ant Design system design, mainly used in back-end enterprise-class products. React component library is a high quality out of the box. Supports almost all current browsers (support IE11 and above), but also supports Electron desktop applications development.
Antd official website: https://ant.design/

1. Install

Use npm install:

cnpm i antd -S

Use yarn installation:

yarn add antd

2. Use

Before use, the need to introduce CSS style:

import 'antd/dist/antd.css';

In the formation of the need to use antd in demand related to the introduction of UI components:

import { Button } from 'antd';
ReactDOM.render(<Button />, document.getElementById('root'));

3. Check the official documentation

Login antd official website address: https://ant.design/
official website will not open, you can use the official mirror address: https://ant-design.gitee.io/index-cn
After opening the website, locate the component in navigation, View tutorial corresponding components according to their needs.

antd official website

We are here to Button component, for example, you can view the code shows the component:
480452-20200308204349095-559815330.png

In the example of different UI styles, you can click the <>button to see the source code, according to the source code examples, in reference to the project in the style component.

You can also view the API, configuration item attributes and learning components on the components:
480452-20200308204526396-1857118309.png

Other components can be learned in accordance with the above method, using UI components are similar, the most important is to learn the API for each component of the configuration items.

Published 124 original articles · won praise 9 · views 20000 +

Guess you like

Origin blog.csdn.net/p445098355/article/details/104745064