Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

vee-validate

> 前端框架
Open source

✅ Painless Vue forms

11.3K stars0 likes1 views
WebsiteGitHub

About

✅ Painless Vue forms

Painless Vue forms



Features

  • ** Easy:** Declarative validation that is familiar and easy to setup
  • ‍♀️ Flexible: Synchronous, Asynchronous, field-level or form-level validation
  • ⚡️ Fast: Build faster forms faster with intuitive API and small footprint
  • ** Minimal:** Only handles the complicated form concerns, gives you full control over everything else
  • ** UI Agnostic:** Works with native HTML elements or your favorite UI library components
  • ** Progressive:** Works whether you use Vue.js as a progressive enhancement or in a complex setup
  • ✅ Built-in Rules: Companion lib with 25+ Rules that covers most needs in most web applications
  • ** i18n:** 45+ locales for built-in rules contributed by developers from all over the world

Getting Started

Installation

bash
# Install with yarn
yarn add vee-validate

# Install with npm
npm install vee-validate --save

Vue version support

The main v4 version supports Vue 3.x only, for previous versions of Vue, check the following the table

vue Version vee-validate version Documentation Link
2.x 2.x or 3.x v2 or v3
3.x 4.x or 5.x v4 or v5

Usage

vee-validate offers two styles to integrate form validation into your Vue.js apps.

Composition API

The fastest way to create a form and manage its validation, behavior, and values is with the composition API.

Create your form with useForm and then use defineField to create your field model and props/attributes and handleSubmit to use the values and send them to an API.

…

You can do so much more than this, for more info check the composition API documentation.

Declarative Components

Higher-order components can also be used to build forms. Register the Field and Form components and create a simple required validator:

xml
<script setup>
import { Field, Form } from 'vee-validate';

// Validation, or use `yup` or `zod`
function required(value) {
  return value ? true : 'This field is required';
}

// Submit handler
function onSubmit(values) {
  // Submit to API
  console.log(values);
}
</script>

<template>
  <Form v-slot="{ errors }" @submit="onSubmit">
    <Field name="field" :rules="required" />

    <span>{{ errors.field }}</span>

    <button>Submit</button>
  </Form>
</template>

The Field component renders an input of type text by default but you can control that

Documentation

Read the documentation and demos.

Contributing

You are welcome to contribute to this project, but before you do, please make sure you read the contribution guide.

Credits

  • Inspired by Laravel's validation syntax
  • v4 API Inspired by Formik's
  • Nested path types by react-hook-form
  • Logo by Baianat

Emeriti

Here we honor past contributors and sponsors who have been a major part on this project.

  • Baianat.

⚖️ License

Released under MIT by @logaretm.

Issues· 172 open

View all issuesOpen on GitHub
  • #5151

    Zod 4 support

    Updated Aug 24, 2026
  • #5152

    Is this project still maintained?

    Updated May 20, 2026
  • #5156

    `toTypedSchema` initializes nested object fields as `{field: undefined}` instead of `undefined` when root schema is `ZodObject`, but not when it is `ZodEffects`

    Updated May 7, 2026
  • #5153

    union errors aren't handled properly with Vee-Validate 4 + Zod 4

    Updated May 5, 2026
  • #4982

    Validation results for not-rendered fields are always present

    Updated May 5, 2026
  • #5149

    Deeply nested array form prunes array attributes, when bound to vee-validate useField and used with 'replace' from useFieldArray

    Updated Mar 19, 2026
  • #5148

    a top-level array as initialValue is corrupted

    Updated Mar 19, 2026
  • #5120

    v4: get an error "Invalid key: Expected "address" but received undefined" if field is object in valibot schema

    Updated Feb 16, 2026
  • #5021

    Breaking Change in `useField` Behavior After v4.11.8 - meta object no longer syncs

    Updated Feb 15, 2026
  • #5119

    ALL your demos do NOT work on the website

    Updated Feb 14, 2026

> Tags

TypeScriptformform-validationformshacktoberfest

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架