vee-validate
✅ Painless Vue forms
vee-validate is a Vue.js library that adds form validation to web apps with minimal code, offering both a composition API style and declarative component wrappers, with support for Yup and Zod schemas.
vee-validate is a TypeScript library for Vue.js that helps developers add form validation to their web applications without needing to write a lot of boilerplate code. When a user fills out a form on a website, validation checks whether the input is correct before it gets submitted. This library handles those checks in a structured way.
vee-validate supports two main approaches for adding validation to forms. The first uses Vue's composition API, where you call functions like useForm and defineField in your component's script to set up the form logic. The second uses declarative components, where you wrap your form fields in special Form and Field tags that handle validation for you. Both approaches provide error messages and submission handling out of the box.
Validation rules can be synchronous or asynchronous, and they can be applied at the level of individual fields or the entire form at once. The library ships with more than 25 built-in rules covering common needs like required fields and minimum lengths. It also includes translations for over 45 languages, contributed by developers from around the world.
vee-validate works with plain HTML inputs as well as with UI component libraries. It focuses only on the form validation logic, leaving styling and layout entirely up to you. If you prefer defining rules in a structured schema format, the library integrates with Yup and Zod.
The library supports Vue 3 in versions 4.x and 5.x, with older versions available for Vue 2. It is released under the MIT license.
Where it fits
- Add email, password, and required-field validation to a Vue 3 login form without writing custom validation logic from scratch
- Build a multi-step form with field-level and form-level error messages using composition API functions like useForm and defineField
- Define all validation rules in a Zod or Yup schema and connect them automatically to Vue form fields
- Display localized validation error messages in over 45 languages for a multilingual web application