Ant Design Vue UI Library

4.2.6 · active · verified Sun Apr 19

Ant Design Vue is an enterprise-class UI component library based on the Ant Design specification, specifically implemented for Vue.js applications. It provides a comprehensive set of high-quality, out-of-the-box components tailored for desktop application development. The library is currently stable at version 4.2.6, with frequent patch releases addressing bug fixes and minor improvements, and larger minor versions introducing new features and optimizations every few months. Its key differentiators include adherence to the well-established Ant Design system, robust TypeScript support (shipping its own types), and strong compatibility with modern Vue 3 ecosystems, including SSR and Electron environments. It offers a structured and opinionated approach to UI development, promoting consistency and reusability.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to set up Ant Design Vue in a Vue 3 application, import components like Button, ConfigProvider, and Table, and use the global message service, along with importing the necessary CSS.

import { createApp } from 'vue';
import { Button, ConfigProvider, Table, message } from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';

const App = {
  setup() {
    const columns = [
      { title: 'Name', dataIndex: 'name', key: 'name' },
      { title: 'Age', dataIndex: 'age', key: 'age' },
      { title: 'Address', dataIndex: 'address', key: 'address' },
    ];

    const data = [
      { key: '1', name: 'John Brown', age: 32, address: 'New York No. 1 Lake Park' },
      { key: '2', name: 'Jim Green', age: 42, address: 'London No. 1 Lake Park' },
      { key: '3', name: 'Joe Black', age: 32, address: 'Sidney No. 1 Lake Park' },
    ];

    const showMessage = () => {
      message.info('Hello from Ant Design Vue!');
    };

    return {
      columns,
      data,
      showMessage,
    };
  },
  template: `
    <ConfigProvider>
      <div style="padding: 24px;">
        <h1>Ant Design Vue Quickstart</h1>
        <Button type="primary" @click="showMessage">Show Message</Button>
        <br/><br/>
        <Table :columns="columns" :data-source="data" />
      </div>
    </ConfigProvider>
  `,
};

createApp(App)
  .use(Button)
  .use(ConfigProvider)
  .use(Table)
  .mount('#app');

// To run this, create an index.html with <div id="app"></div> and include a script tag for this code.
// Ensure you have Vue 3 and ant-design-vue installed in your project.
// e.g., <script type="module"> // Your quickstart code </script>

view raw JSON →