Element Plus

2.13.7 · active · verified Sun Apr 19

Element Plus is a comprehensive UI component library for Vue 3, built entirely with the Composition API and TypeScript. It offers a rich set of customizable components designed to streamline development of web applications. The library is currently at version 2.13.7 and maintains a frequent release cadence, often releasing multiple patch versions per month to address bugs and introduce minor features, with occasional minor versions for larger feature sets. Key differentiators include its strong TypeScript support, native Vue 3 reactivity, and an extensive ecosystem of tools and documentation, making it a robust alternative to older Vue 2 UI libraries like Element UI.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates setting up a basic Vue 3 application with Element Plus, globally installing the library, importing its styles, and using several core components like ElButton, ElInput, and ElLink, along with programmatic usage of ElMessage.

import { createApp, ref } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import { ElMessage } from 'element-plus'; // For programmatic use

const App = {
  setup() {
    const inputValue = ref('');
    const message = ref('Hello Element Plus!');

    const showFeedback = () => {
      ElMessage.success('Button clicked!');
    };

    return {
      inputValue,
      message,
      showFeedback
    };
  },
  template: `
    <div style="text-align: center; margin-top: 50px;">
      <h1>{{ message }}</h1>
      <ElButton type="primary" @click="showFeedback">Click Me</ElButton>
      <ElInput 
        v-model="inputValue" 
        placeholder="Type something..."
        style="width: 300px; margin: 20px;"
      />
      <p v-if="inputValue">You typed: {{ inputValue }}</p>
      <ElLink href="https://element-plus.org/" target="_blank">Documentation</ElLink>
    </div>
  `
};

const app = createApp(App);
app.use(ElementPlus);
app.mount('#app');

view raw JSON →