VOOZH about

URL: https://blog.logrocket.com/introduction-to-ant-design/

⇱ Introduction to Ant Design - LogRocket Blog


2020-05-01
1036
#react
Kapeel Kokane
17737
πŸ‘ Image

See how LogRocket's Galileo AI surfaces the most severe issues for you

No signup required

Check it out

πŸš€ Sign up for The Replay newsletter

The Replay is a weekly newsletter for dev and engineering leaders.

Delivered once a week, it's your curated guide to the most important conversations around frontend dev, emerging AI tools, and the state of modern software.

Introduction

In a discussion about top frontend design languages, Material Design by Google is one of the most popular contenders for the favorite spot, but there is a close, maybe lesser-known, competitor, that is Ant Design. With some of the big players in their respective industries like Alibaba, Tencent, Baidu all using Ant Design, let’s explore some of the key features that make Ant Design special compared to others.

πŸ‘ ant design

The design principles of Ant Design

Ant design, according to its own design values page, focusses on a user experience that is:

  • Natural β€” a visual interaction that is devoid of complexity and feels natural to use
  • Certain β€”  establish design rules such that it avoids low-efficiency & difficult-to-maintain products
  • Meaningful β€”  design interfaces keeping the needs of the end-user in mind
  • Growing β€” design interfaces that improve the discoverability of functions and values of the product

Strongly opinionated

While providing guides on most of the styling needs for user interface design like colors, layout, font, icons, Ant Design also lays down certain best practices with respect to several visual design principles and clearly marks out the good from the bad ones. Here are a couple of examples from their reference docs:

Text alignment

πŸ‘ alignment

Contrast

πŸ‘ contrast

Iconography & typography

Ant Design also provides full-fledged in-house support for icons and typography and it’s quite easy to incorporate in the project too. For instance, in order to use the provided icons in your project, all that needs to be done is:

npm install --save @ant-design/icons

to install the icon pack:

import { HomeOutlined } from '@ant-design/icons'
ReactDOM.render(<div><HomeOutlined /></div>, mountNode);

Layout support

Ant Design provides its own alternatives to CSS Flexbox implementation for laying out UI items and to maintain a fluid and responsive user interface. For the same purpose, Ant Design provides row and column components that can be used as alternatives to equivalent divs with flex-direction row and column respectively. For managing size, it accepts a span prop similar to what Bootstrap does:

<Row>
 <Col span={12}>col-12</Col>
 <Col span={12}>col-12</Col>
</Row>

In addition to that, Ant design provides some of the most common layouts, with Navigation Bar, Side Menu, BreadCrumbs, and the main layout area (with different styles) as standard boilerplate that one can use straight away in the project. For example, the layout below can be easily achieved by copying the boilerplate code from their official docs page.

πŸ‘ Image

Extensive component support

 Common components

Some of the most widely used form elements are of course available for use with a huge variety of customization options. Here are a few examples along with the code to create generic versions of them.

Text input

πŸ‘ text input

// component code
<Input 
 size="large" 
 value={this.state.inputVal}
 placeholder="large size"
 onChange={(e) => this.setState({ inputVal: e.target.value })}
 prefix={<UserOutlined />} // prefixes the user image at the beginning
/>

Checkbox

πŸ‘ check box

// on change handler
onChange = e => {
 this.setState({
 checked: e.target.checked,
 });
};
// checkbox component
<Checkbox
checked={this.state.checked}
disabled={this.state.disabled} // can be managed via state independently
onChange={this.onChange}
>
{label}
</Checkbox>

Radio buttons

πŸ‘ radio buttons

// on change handler
onChange = e => {
 this.setState({
 value: e.target.value,
 });
};

// radio component, manage the β€˜disabled’ boolean separately
<>
 <Radio value={1} disabled={this.state.disabled}>
 Value 1
 </Radio>
 <br />
 <Radio value={2} disabled={this.state.disabled}>
 Value 2
 </Radio>
</>

Slider

πŸ‘ slider

// on change handler
onChange = value => {
 this.setState({
 inputValue: value,
 });
};

// slider component
<Slider
 min={1} // define a range
 max={20}
 disabled={this.state.disabled} // manage β€˜disabled’ separately 
 onChange={this.onChange}
 value={typeof inputValue === 'number' ? inputValue : 0}
/>

And, the best part is, all the code for using any variation of these components is available on the same page. You can easily access it by clicking the <> button like so:
πŸ‘ select

Compound components

In addition to the basic components mentioned above, there is also a broad range of compound components that Ant Design provides, which supports rapid prototyping and development. These are the components which are widely used in modern user interfaces but take quite an effort to code from scratch. Here are some examples along with Ant Design equivalent code:

Comment

πŸ‘ comment

<Comment
 actions={actions} // the action button settings
 author={<a>Han Solo</a>} // the name of comment author
 avatar={
 <Avatar src="source_for_avatar.png" alt="Han Solo"/>
 }
 content={// content here} // main comment
/>

Card

πŸ‘ cards

<div className="site-card-border-less-wrapper"> // the css class
 <Card title="Card title" bordered={false} style={{ width: 300 }}>
 <p>Card content</p>
 <p>Card content</p>
 <p>Card content</p>
 </Card>
</div>

 Carousel

πŸ‘ carousel



// Carousel with autoplay enabled
<Carousel autoplay> 
 <div>
 <h3>1</h3>
 </div>
 <div>
 <h3>2</h3>
 </div>
 <div>
 <h3>2</h3>
 </div>
</Carousel>

Timeline

πŸ‘ timeline

<Timeline>
 <Timeline.Item>Create a services site 2015-09-01</Timeline.Item>
 <Timeline.Item>Solve initial network problems 2015-09-01</Timeline.Item>
 <Timeline.Item>Technical testing 2015-09-01</Timeline.Item>
 <Timeline.Item>Network problems being solved 2015-09-01</Timeline.Item>
</Timeline>

React support & documentation

The Ant design framework is designed from the ground up keeping in mind the React methodologies. All the components mentioned above have direct support for incorporation with React components available. Also, support for other popular frameworks like Angular and Vue are being developed by the community.

Conclusion

With a fluid, responsive UI, clean design language, and also visualization support through AntV, Ant Design is surely on the way to grab a huge chunk of the market share when it comes to Industry grade dashboards. Given the extensive list of components, features, and customizations provided by Ant Design, it counts as a worthy candidate when it comes to the selection of your next frontend design framework.

Get set up with LogRocket's modern React error tracking in minutes:

  1. Visit https://logrocket.com/signup/ to get an app ID
  2. Install LogRocket via npm or script tag. LogRocket.init() must be called client-side, not server-side

    $ npm i --save logrocket 
    
    // Code:
    
    import LogRocket from 'logrocket'; 
    LogRocket.init('app/id');
     
    // Add to your HTML:
    
    <script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script>
    <script>window.LogRocket && window.LogRocket.init('app/id');</script>
     
  3. (Optional) Install plugins for deeper integrations with your stack:
    • Redux middleware
    • NgRx middleware
    • Vuex plugin
Get started now
πŸ‘ Image
πŸ‘ Image
πŸ‘ Image

Stop guessing about your digital experience with LogRocket

Get started for free

Recent posts:

How to add authentication to a React Native app with Better Auth

Learn how to build a full React Native auth system using Better Auth and Expo β€” with email/password login, Google OAuth, session persistence, and protected routes.

πŸ‘ Image
Chinwike Maduabuchi
Jun 9, 2026 β‹… 13 min read

AI dev tool power rankings & comparison [June 2026]

Compare the top AI development tools and models of June 2026. View updated rankings, feature breakdowns, and find the best fit for you.

πŸ‘ Image
Chizaram Ken
Jun 8, 2026 β‹… 11 min read

How to check username availability at scale with Bloom filters

Learn how Bloom filters reduce database lookups for username availability checks while preserving correctness at scale.

πŸ‘ Image
Rosario De Chiara
Jun 8, 2026 β‹… 6 min read

An advanced guide to Nuxt testing and mocking

Learn how to test Nuxt apps with Vitest, @nuxt/test-utils, runtime mocks, server route mocks, and Playwright e2e tests.

πŸ‘ Image
Sebastian Weber
Jun 5, 2026 β‹… 15 min read
View all posts

Would you be interested in joining LogRocket's developer community?

Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.

Sign up now