vee-validate
Template-based form validation for Vue 3 — schema validation, error messages, and field-level state with Zod/Yup integration.
vee-validate
VueTemplate-based form validation for Vue 3 — schema validation, error messages, and field-level state with Zod/Yup integration.
Fit
Bundle (gzip)
13.0 kB
43.2 kB raw
Install size includes transitive dependencies. Bundle size is gzipped browser payload.
Freshness
The Problem
Validating Vue forms means managing error state for every field, handling async validators, showing/hiding error messages at the right time, and integrating with schema validation libraries — all of which requires significant boilerplate.
What It Does
vee-validate provides useForm, useField, and <Field> / <ErrorMessage> components that track touched, dirty, and valid state per field. It integrates directly with Zod, Yup, and Valibot via adapters so your existing schema doubles as the validation logic.
Installation
npm install vee-validate @vee-validate/zod zodUsage Example
<script setup lang="ts">
import { useForm } from 'vee-validate';
import { toTypedSchema } from '@vee-validate/zod';
import { z } from 'zod';
const { handleSubmit, errors } = useForm({
validationSchema: toTypedSchema(
z.object({ email: z.string().email(), password: z.string().min(8) })
),
});
const onSubmit = handleSubmit((values) => console.log(values));
</script>
<template>
<form @submit="onSubmit">
<Field name="email" type="email" />
<ErrorMessage name="email" />
<button type="submit">Login</button>
</form>
</template>Related packages
A complete component library for Vue 3 with a clean, desktop-oriented design system.
floating-vueVueTooltip, popover, and dropdown directives for Vue 3 — powered by Floating UI with automatic placement and overflow detection.
naive-uiVueFairly complete Vue 3 UI component library — 90+ components with a TypeScript-first design and no dependency on legacy CSS frameworks.
piniaVueThe intuitive, type-safe, and lightweight state management store for Vue — the official successor to Vuex.
@tanstack/vue-queryVuePowerful async state management for Vue — data fetching, caching, background refetching, and server state synchronization.