Vant: Mobile UI Components for Vue

4.9.24 · active · verified Tue Apr 21

Vant is a lightweight and highly customizable UI component library designed for mobile web applications built with Vue.js. The current stable version series is 4.x, specifically 4.9.24 for Vue 3 projects, while Vant 2.x (e.g., 2.13.9) continues to support Vue 2. The library maintains an active release cadence, frequently adding new features, bug fixes, and improvements within its major versions. Key differentiators include its small bundle size (1KB average per component min+gzip), over 80 high-quality components, zero third-party dependencies, strong TypeScript support, extensive documentation, and comprehensive feature set including tree-shaking, custom themes, accessibility, dark mode, SSR, and i18n with 30+ built-in languages. It also provides dedicated modules for Nuxt 2 and Nuxt 3.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to set up a basic Vue 3 application, import Vant components (Button, Toast), register them globally, and include the necessary CSS styles to render a functional Vant button and show a toast message.

import { createApp } from 'vue';
import { Button, Toast } from 'vant';
import 'vant/lib/index.css';

const app = createApp({
  template: `
    <van-button type="primary" @click="showToast">Click me</van-button>
  `,
  methods: {
    showToast() {
      Toast('Hello Vant!');
    }
  }
});

app.use(Button);
app.use(Toast);

app.mount('#app');

view raw JSON →