4.14.6 • Published 27 days ago

vee-validate v4.14.6

Weekly downloads
273,251
License
MIT
Repository
github
Last release
27 days ago

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

# 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 Versionvee-validate versionDocumentation Link
2.x2.x or 3.xv2 or v3
3.x4.xv4

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.

<script setup>
import { useForm } from 'vee-validate';

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

// Create the form
const { defineField, handleSubmit, errors } = useForm({
  validationSchema: {
    field: required,
  },
});

// Define fields
const [field, fieldProps] = defineField('field');

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

<template>
  <form @submit="onSubmit">
    <input v-model="field" v-bind="fieldProps" />
    <span>{{ errors.field }}</span>

    <button>Submit</button>
  </form>
</template>

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:

<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

Emeriti

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

⚖️ License

Released under MIT by @logaretm.

@pagemaker.io/pagemakerform-schema-gt4wwork-schedule-uinbzifyzr-dymnic-form-vuecp-ui-libraryin-syl@repzio/vue-componentsaino-vuesaxpls-gcliangchuan-uibillingman-web-customer-componentmercedesbenzvaluemycarac-components-dynamicappup-componentsappup-components-dynamiceditor-texto-app@fajarullah/vue-validation-componentsapplauncherfavmenuckuessner2applauncherfavmenuckuessner3email-componentbackstage_vuemercedes-tradetiringo-sharedshygonecinc-cloud-app@glance-project/alice-service-workmybankmobile-testpppquasar-ui-tmt-kit@yiird/gavin-ui-elementspeckle-adminget-net-widget@yiird/gavin-ui-libcarstackrestaurateurapp@cisweb/component-librarypegadaian-components@quizbound/quiz-v2@tangguoxiongbear/baseui@skoda-dms/component-libhex-3m-uijb-test-vite-windicss-projectweichenyu-test@mernjs/vue-vuexvalhalla-ui@3d-print-farm/client@bigpicturemedical/medkit-component-form-itemclient-test-01drupal-vuejsfirst-npm-abdulmlik@frontend-melhor-envio/mui-corecrypto-voucher-widget@charnwood-borough/vue-tagsinput@charnwood-borough/vue2-typeaheadchuchuro-authvault-vue305-ui-kitnx-libssaludtools-ui-library@voormeerwaarde/vue-components-library@sorcecloud/sectionlib-vue-componentslc-apmlemonitor-applicationnpm-test-ah@gits-id/componentsspace.web.scoringfields@infinitebrahmanuniverse/nolb-veeav-themeheader_cesi_eatfnst-uiwbu-design-system@everything-registry/sub-chunk-3046tlsclient-shared-modulesds-tchlekai-uileki-uinaue-library-frontendjsonforms-vue-primevue@requrv/requrv-vue-uifactory-kit-testmanage-layouttb-ds-web-librarytalebase-uitalent-findsword-vue-uisword-web-uiswordpaas-uiswordpass-uisyswin-wf-uitaghash-frontendtest-nuxt-layertest-p-dwidgets-eyantrawmsman-web-componentvue-ghost-uivue-material-rtlvue-laravelvue-laravel-componentsvue-main-componentsvue-atomic-design
4.14.5

27 days ago

4.14.6

27 days ago

4.14.4

30 days ago

4.14.1

1 month ago

4.14.2

1 month ago

4.14.3

1 month ago

4.14.0

1 month ago

4.13.2

5 months ago

4.13.0

6 months ago

4.13.1

6 months ago

4.12.8

7 months ago

4.12.7

7 months ago

4.12.6

9 months ago

4.12.5

10 months ago

4.12.4

11 months ago

4.12.3

11 months ago

4.12.0

12 months ago

4.12.1

12 months ago

4.12.2

12 months ago

4.12.0-alpha.1

1 year ago

4.12.0-alpha.0

1 year ago

4.9.6

1 year ago

4.10.9

1 year ago

4.10.5

1 year ago

4.10.6

1 year ago

4.10.7

1 year ago

4.10.8

1 year ago

4.10.1

1 year ago

4.10.2

1 year ago

4.10.3

1 year ago

4.10.4

1 year ago

4.10.0

1 year ago

4.11.8

1 year ago

4.11.4

1 year ago

4.11.5

1 year ago

4.11.6

1 year ago

4.11.7

1 year ago

4.11.0

1 year ago

4.11.1

1 year ago

4.11.2

1 year ago

4.11.3

1 year ago

4.9.4

2 years ago

4.9.3

2 years ago

4.9.5

2 years ago

4.9.0

2 years ago

4.9.2

2 years ago

4.9.1

2 years ago

4.8.5

2 years ago

4.8.4

2 years ago

4.8.6

2 years ago

4.8.1

2 years ago

4.8.0

2 years ago

4.8.3

2 years ago

4.8.2

2 years ago

4.7.4

2 years ago

3.4.15

2 years ago

4.7.0

2 years ago

4.7.2

2 years ago

4.7.1

2 years ago

4.7.3

2 years ago

4.6.7

2 years ago

4.6.9

2 years ago

4.6.8

2 years ago

4.6.10

2 years ago

4.6.1

2 years ago

4.6.0

2 years ago

4.6.6

2 years ago

4.6.3

2 years ago

4.6.2

2 years ago

4.6.5

2 years ago

4.6.4

2 years ago

4.5.10

3 years ago

4.5.11

3 years ago

4.5.8

3 years ago

4.5.7

3 years ago

4.5.9

3 years ago

3.4.14

3 years ago

4.5.6

3 years ago

4.5.5

3 years ago

4.5.4

3 years ago

4.5.3

3 years ago

4.5.2

3 years ago

4.5.1

3 years ago

4.5.0

3 years ago

3.4.13

3 years ago

4.4.11

3 years ago

4.5.0-alpha.6

3 years ago

4.4.10

3 years ago

4.5.0-alpha.5

3 years ago

3.4.12

3 years ago

4.5.0-alpha.4

3 years ago

4.4.9

3 years ago

4.4.8

3 years ago

4.5.0-alpha.3

3 years ago

4.4.7

3 years ago

3.4.11

3 years ago

4.5.0-alpha.2

3 years ago

4.4.6

3 years ago

4.5.0-alpha.1

3 years ago

3.4.10

3 years ago

4.5.0-alpha.0

3 years ago

4.4.3

3 years ago

4.4.2

3 years ago

4.4.5

3 years ago

4.4.4

3 years ago

3.4.8

3 years ago

3.4.7

3 years ago

3.4.9

3 years ago

4.4.1

4 years ago

4.4.0

4 years ago

4.3.2

4 years ago

4.3.1

4 years ago

4.3.4

4 years ago

4.3.3

4 years ago

4.4.0-alpha.0

4 years ago

4.3.6

4 years ago

4.3.5

4 years ago

4.4.0-alpha.2

4 years ago

4.4.0-alpha.1

4 years ago

3.4.6

4 years ago

4.3.0

4 years ago

4.2.4

4 years ago

4.2.3

4 years ago

4.2.2

4 years ago

4.1.20

4 years ago

4.2.1

4 years ago

4.2.0

4 years ago

4.1.19

4 years ago

4.1.18

4 years ago

4.1.17

4 years ago

4.1.16

4 years ago

4.1.15

4 years ago

4.1.14

4 years ago

4.1.13

4 years ago

4.1.12

4 years ago

4.1.11

4 years ago

4.1.10

4 years ago

4.1.9

4 years ago

4.1.8

4 years ago

4.1.7

4 years ago

4.1.6

4 years ago

4.1.4

4 years ago

4.1.5

4 years ago

4.1.3

4 years ago

4.1.2

4 years ago

4.1.0

4 years ago

4.1.1

4 years ago

4.0.7

4 years ago

4.0.6

4 years ago

4.0.5

4 years ago

4.0.4

4 years ago

4.0.3

4 years ago

4.0.2

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.4.5

4 years ago

3.4.4

4 years ago

4.0.0-beta.19

4 years ago

4.0.0-beta.18

4 years ago

4.0.0-beta.17

4 years ago

4.0.0-beta.16

4 years ago

4.0.0-beta.15

4 years ago

4.0.0-beta.14

4 years ago

4.0.0-beta.13

4 years ago

3.4.3

4 years ago

4.0.0-beta.12

4 years ago

4.0.0-beta.11

4 years ago

4.0.0-beta.10

4 years ago

3.4.2

4 years ago

4.0.0-beta.9

4 years ago

4.0.0-beta.8

4 years ago

3.4.1

4 years ago

4.0.0-beta.7

4 years ago

4.0.0-beta.6

4 years ago

4.0.0-beta.5

4 years ago

4.0.0-beta.4

4 years ago

4.0.0-beta.3

4 years ago

4.0.0-beta.2

4 years ago

4.0.0-beta.1

4 years ago

4.0.0-beta.0

4 years ago

3.4.0

4 years ago

4.0.0-alpha.14

4 years ago

4.0.0-alpha.13

4 years ago

4.0.0-alpha.12

4 years ago

3.3.10

4 years ago

3.3.11

4 years ago

4.0.0-alpha.11

4 years ago

4.0.0-alpha.10

4 years ago

4.0.0-alpha.9

4 years ago

4.0.0-alpha.8

4 years ago

3.3.9

4 years ago

4.0.0-alpha.7

4 years ago

3.3.8

4 years ago

4.0.0-alpha.6

4 years ago

4.0.0-alpha.5

4 years ago

4.0.0-alpha.4

4 years ago

4.0.0-alpha.3

4 years ago

4.0.0-alpha.2

4 years ago

4.0.0-alpha.1

4 years ago

3.3.7

4 years ago

3.3.6

4 years ago

3.3.5

4 years ago

3.3.4

4 years ago

3.3.3

4 years ago

3.3.2

4 years ago

3.3.1

4 years ago

3.3.0

5 years ago

3.2.5

5 years ago

3.2.4

5 years ago

3.2.3

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.11

5 years ago

3.0.10

5 years ago

3.0.9

5 years ago

3.0.8

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.2.15

5 years ago

2.2.14

5 years ago

2.2.13

5 years ago

2.2.12

5 years ago

2.2.11

5 years ago

2.2.10

5 years ago

2.2.9

5 years ago

2.2.8

6 years ago

2.2.7

6 years ago

2.2.6

6 years ago

2.2.5

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.7

6 years ago

2.1.6

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0-beta.11

6 years ago

2.1.0-beta.10

6 years ago

2.1.0-beta.9

6 years ago

2.1.0-beta.8

6 years ago

2.1.0-beta.7

6 years ago

2.1.0-beta.6

6 years ago

2.1.0-beta.5

6 years ago

2.1.0-beta.4

6 years ago

2.1.0-beta.3

6 years ago

2.1.0-beta.2

6 years ago

2.1.0

6 years ago

2.1.0-beta.1

6 years ago

2.1.0-beta.0

6 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

2.0.0-rc.27

7 years ago

2.0.0-rc.26

7 years ago

2.0.0-rc.25

7 years ago

2.0.0-rc.24

7 years ago

2.0.0-rc.23

7 years ago

2.0.0-rc.22

7 years ago

2.0.0-rc.21

7 years ago

2.0.0-rc.20

7 years ago

2.0.0-rc.19

7 years ago

2.0.0-rc.18

7 years ago

2.0.0-rc.17

7 years ago

2.0.0-rc.16

7 years ago

2.0.0-rc.15

7 years ago

2.0.0-rc.14

7 years ago

2.0.0-rc.13

7 years ago

2.0.0-rc.12

7 years ago

2.0.0-rc.11

7 years ago

2.0.0-rc.10

7 years ago

2.0.0-rc.9

7 years ago

2.0.0-rc.8

7 years ago

2.0.0-rc.7

7 years ago

2.0.0-rc.6

7 years ago

2.0.0-rc.5

7 years ago

2.0.0-rc.4

8 years ago

2.0.0-rc.3

8 years ago

2.0.0-rc.2

8 years ago

2.0.0-rc.1

8 years ago

2.0.0-beta.25

8 years ago

2.0.0-beta.24

8 years ago

2.0.0-beta.23

8 years ago

2.0.0-beta.22

8 years ago

2.0.0-beta.21

8 years ago

2.0.0-beta.20

8 years ago

2.0.0-beta.19

8 years ago

2.0.0-beta.18

8 years ago

1.0.0-beta.11

8 years ago

2.0.0-beta.17

8 years ago

2.0.0-beta.16

8 years ago

1.0.0-beta.10

8 years ago

2.0.0-beta.15

8 years ago

2.0.0-beta.14

8 years ago

1.0.0-beta.9

8 years ago

2.0.0-beta.13

8 years ago

1.0.0-beta.8

8 years ago

1.0.0-beta.7

8 years ago

2.0.0-beta.12

8 years ago

2.0.0-beta.11

8 years ago

1.0.0-beta.6

8 years ago

2.0.0-beta.10

8 years ago

1.0.0-beta.5

8 years ago

2.0.0-beta.9

8 years ago

1.0.0-beta.4

8 years ago

1.0.0-beta.3

8 years ago

2.0.0-beta.8

8 years ago

1.0.0-beta.2

8 years ago

1.0.0-beta.1

8 years ago

2.0.0-beta.7

8 years ago

2.0.0-beta.6

8 years ago

1.0.0-beta.0

8 years ago

2.0.0-beta.5

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

2.0.0-beta.4

8 years ago

2.0.0-beta.3

8 years ago

0.9.1

8 years ago

2.0.0-beta.2

8 years ago

2.0.0-beta.1

8 years ago

2.0.0-beta.0

8 years ago

0.9.0

8 years ago