Convert Figma logo to code with AI

ant-design logoant-design

An enterprise-class UI design language and React UI library

91,830
48,732
91,830
1,221

Top Related Projects

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

39,623

🐉 Vue Component Framework

Bootstrap components built with React

A utility-first CSS framework for rapid UI development.

37,442

⚡️ Simple, Modular & Accessible UI Components for your React Applications

Quick Overview

Ant Design is a comprehensive design system and React UI library for building enterprise-level web applications. It provides a set of high-quality React components, powerful theme customization, and a design language that emphasizes clarity and efficiency.

Pros

  • Extensive component library with a wide range of UI elements
  • Consistent and professional design language suitable for enterprise applications
  • Strong community support and regular updates
  • Excellent documentation and examples

Cons

  • Large bundle size, which may impact initial load times
  • Opinionated design system that may not fit all project styles
  • Steep learning curve for advanced customization
  • Some components may be overly complex for simple use cases

Code Examples

  1. Basic Button Component:
import { Button } from 'antd';

const MyComponent = () => (
  <Button type="primary">Click me</Button>
);
  1. Form with Input and Select:
import { Form, Input, Select } from 'antd';

const { Option } = Select;

const MyForm = () => (
  <Form>
    <Form.Item name="name" label="Name">
      <Input />
    </Form.Item>
    <Form.Item name="category" label="Category">
      <Select>
        <Option value="electronics">Electronics</Option>
        <Option value="clothing">Clothing</Option>
      </Select>
    </Form.Item>
  </Form>
);
  1. Table with Pagination:
import { Table } from 'antd';

const columns = [
  { title: 'Name', dataIndex: 'name', key: 'name' },
  { title: 'Age', dataIndex: 'age', key: 'age' },
];

const data = [
  { key: 1, name: 'John Brown', age: 32 },
  { key: 2, name: 'Jim Green', age: 42 },
];

const MyTable = () => (
  <Table columns={columns} dataSource={data} pagination={{ pageSize: 10 }} />
);

Getting Started

To start using Ant Design in your React project:

  1. Install Ant Design:
npm install antd
  1. Import and use components in your React application:
import React from 'react';
import { Button } from 'antd';
import 'antd/dist/antd.css'; // Import Ant Design CSS

const App = () => (
  <div className="App">
    <Button type="primary">Hello, Ant Design!</Button>
  </div>
);

export default App;
  1. For more advanced usage, refer to the official Ant Design documentation for customization options and component APIs.

Competitor Comparisons

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Pros of Material-UI

  • More extensive component library with a wider range of UI elements
  • Better TypeScript support and type definitions
  • Stronger community support and more frequent updates

Cons of Material-UI

  • Steeper learning curve, especially for complex customizations
  • Larger bundle size, which may impact initial load times
  • Less opinionated design, requiring more effort to achieve a cohesive look

Code Comparison

Material-UI:

import { Button } from '@mui/material';

<Button variant="contained" color="primary">
  Click me
</Button>

Ant Design:

import { Button } from 'antd';

<Button type="primary">
  Click me
</Button>

Both libraries offer similar component APIs, but Material-UI provides more customization options out of the box. Ant Design's approach is generally simpler and more straightforward, while Material-UI offers greater flexibility at the cost of added complexity.

Material-UI and Ant Design are both popular React UI component libraries, each with its strengths and weaknesses. Material-UI excels in its extensive component offerings and strong TypeScript support, while Ant Design is known for its ease of use and cohesive design language. The choice between the two often depends on project requirements, team expertise, and design preferences.

39,623

🐉 Vue Component Framework

Pros of Vuetify

  • Extensive Material Design component library with built-in responsive layouts
  • Robust theming system with easy customization options
  • Strong TypeScript support and integration

Cons of Vuetify

  • Steeper learning curve due to Material Design specifics
  • Larger bundle size compared to Ant Design
  • Less flexibility in design customization outside Material Design guidelines

Code Comparison

Vuetify button example:

<template>
  <v-btn color="primary" @click="handleClick">
    Click me
  </v-btn>
</template>

Ant Design button example:

import { Button } from 'antd';

const MyComponent = () => (
  <Button type="primary" onClick={handleClick}>
    Click me
  </Button>
);

Both libraries offer similar component APIs, but Vuetify uses Vue-specific syntax while Ant Design uses JSX. Vuetify's approach is more tightly integrated with Vue's template system, while Ant Design's components can be easily used in React applications.

Vuetify's Material Design focus provides a consistent look and feel out of the box, but may require more effort to customize beyond its design system. Ant Design offers more flexibility in styling and is generally easier to adapt to custom designs.

Overall, Vuetify is well-suited for projects that want to adhere to Material Design principles, while Ant Design offers more versatility for custom designs and React integration.

Bootstrap components built with React

Pros of React Bootstrap

  • Familiar Bootstrap styling and components for developers already using Bootstrap
  • Lightweight and focused solely on React integration of Bootstrap
  • Easier learning curve for those transitioning from vanilla Bootstrap

Cons of React Bootstrap

  • Less comprehensive component library compared to Ant Design
  • Fewer advanced and specialized components for complex UI requirements
  • Less frequent updates and potentially slower adoption of new features

Code Comparison

React Bootstrap:

import { Button } from 'react-bootstrap';

<Button variant="primary">Click me</Button>

Ant Design:

import { Button } from 'antd';

<Button type="primary">Click me</Button>

Both libraries offer similar basic component usage, but Ant Design generally provides more customization options and advanced features for complex scenarios.

React Bootstrap is an excellent choice for projects that require a familiar Bootstrap look and feel with React integration. It's lightweight and easy to adopt for teams already using Bootstrap.

Ant Design, on the other hand, offers a more comprehensive set of components and advanced features, making it suitable for larger, more complex applications. It also provides a distinct design language that may be preferred for projects seeking a modern, cohesive UI.

A utility-first CSS framework for rapid UI development.

Pros of Tailwind CSS

  • Highly customizable and flexible utility-first approach
  • Smaller bundle size and better performance optimization
  • Rapid prototyping and development with pre-built classes

Cons of Tailwind CSS

  • Steeper learning curve for developers new to utility-first CSS
  • Can lead to longer class names and potentially cluttered HTML
  • Less out-of-the-box styled components compared to Ant Design

Code Comparison

Tailwind CSS:

<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
  Click me
</button>

Ant Design:

import { Button } from 'antd';

<Button type="primary">Click me</Button>

Tailwind CSS focuses on utility classes for styling, while Ant Design provides pre-styled components. Tailwind offers more granular control over styles, but Ant Design provides a more cohesive design system out of the box. Tailwind is ideal for custom designs and flexibility, while Ant Design excels in rapid development with consistent UI components. The choice between them depends on project requirements, team preferences, and design goals.

37,442

⚡️ Simple, Modular & Accessible UI Components for your React Applications

Pros of Chakra UI

  • More flexible and customizable design system
  • Better support for responsive design out of the box
  • Smaller bundle size, leading to faster load times

Cons of Chakra UI

  • Less comprehensive component library compared to Ant Design
  • Newer project with a smaller community and ecosystem
  • Steeper learning curve for developers new to styled-system approach

Code Comparison

Ant Design button example:

import { Button } from 'antd';

const MyButton = () => (
  <Button type="primary" size="large">
    Click me
  </Button>
);

Chakra UI button example:

import { Button } from '@chakra-ui/react';

const MyButton = () => (
  <Button colorScheme="blue" size="lg">
    Click me
  </Button>
);

Both libraries offer a similar API for basic components, but Chakra UI provides more flexibility in styling through props. Ant Design has a more opinionated design system, while Chakra UI allows for easier customization to match specific design requirements.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Ant Design

An enterprise-class UI design language and React UI library.

CI status codecov NPM version NPM downloads

FOSSA Status

Follow Twitter Renovate status dumi Issues need help

Changelog · Report Bug · Request Feature · English · 中文

❤️ Sponsors and Backers

✨ Features

  • 🌈 Enterprise-class UI designed for web applications.
  • 📦 A set of high-quality React components out of the box.
  • 🛡 Written in TypeScript with predictable static types.
  • ⚙️ Whole package of design resources and development tools.
  • 🌍 Internationalization support for dozens of languages.
  • 🎨 Powerful theme customization based on CSS-in-JS.

🖥 Environment Support

  • Modern browsers
  • Server-side Rendering
  • Electron
Edge
Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Electron
Electron
Edgelast 2 versionslast 2 versionslast 2 versionslast 2 versions

📦 Install

npm install antd
yarn add antd
pnpm add antd

🔨 Usage

import { Button, DatePicker } from 'antd';

export default () => (
  <>
    <Button type="primary">PRESS ME</Button>
    <DatePicker placeholder="select date" />
  </>
);

🔗 Links

⌨️ Development

Use opensumi.run, a free online pure front-end dev environment.

opensumi.run

Or clone locally:

$ git clone git@github.com:ant-design/ant-design.git
$ cd ant-design
$ npm install
$ npm start

Open your browser and visit http://127.0.0.1:8001 , see more at Development.

🤝 Contributing PRs Welcome

Top Contributors of ant-design/ant-design - Last 28 days Performance Stats of ant-design/ant-design - Last 28 days
New participants of ant-design - past 28 days

Let's build a better antd together.

We warmly invite contributions from everyone. Before you get started, please take a moment to review our Contributing Guide. Feel free to share your ideas through Pull Requests or GitHub Issues. If you're interested in enhancing our codebase, explore the Development Instructions and enjoy your coding journey! :)

For collaborators, adhere to our Pull Request Principle and utilize our Pull Request Template when creating a Pull Request.

Issue funding

We use Polar.sh and Issuehunt to up-vote and promote specific features that you would like to see and implement. Check our backlog and help us:

Let's fund issues in this repository

NPM DownloadsLast 30 Days