Getting started


You can install this plugin via npm or via a CDN.


npm install vee-validate@"<3.0.0" --save


  <!-- jsdelivr cdn -->
  <script src="<3.0.0/dist/vee-validate.js"></script>

  <!-- unpkg -->
  <script src="<3.0.0"></script>



Examples use the ES2015 syntax, make sure to brush up on ES2015 if you haven't already.

import Vue from 'vue';
import VeeValidate from 'vee-validate';


or include the script directly

  <script src="path/to/vue.js"></script>
  <script src="path/to/vee-validate.js"></script>
    Vue.use(VeeValidate); // good to go.

Basic Example

All you need is to add the v-validate directive to the input you wish to validate and make sure your input has a name attribute for error messages generation.

Then, pass to the directive a rules string which contains a list of validation rules separated by a pipe '|'. For the following example, the validation rules are straightforward. Use required to indicate that the field is required and email to indicate that the field must be an email. To combine both rules we assign the string value required|email to the v-validate expression value.

<input v-validate="'required|email'" name="email" type="text">

To display the error message we simply use the errors.first method to fetch the first error generated for the field:

<span>{{ errors.first('email') }}</span>


Here is the basic example in action

More Examples


Client-side validation is never a substitute for server-side validation. Make sure to validate any input from the user on your backend as well.


There are other ways to install the plugin, check them out.