# @vee-validate/rules

> Form Validation for Vue.js

Latest version **4.15.1** (published 2025-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vee-validate/rules
pnpm add @vee-validate/rules
yarn add @vee-validate/rules
bun add @vee-validate/rules
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; has provenance.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.15.1 |
| Published | 2025-06-07 |
| First published | 2020-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 76.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | Abdelrahman Awad |
| Maintainers | logaretm |
| Keywords | VueJS, Vue, validation, validator, inputs, form |

## Links

- npm: https://www.npmjs.com/package/@vee-validate/rules
- Repository: https://github.com/logaretm/vee-validate
- Homepage: https://vee-validate.logaretm.com/v4/guide/global-validators
- Issues: https://github.com/logaretm/vee-validate/issues
- npm.io page: https://npm.io/package/@vee-validate/rules

## Dependencies (1)

- [vee-validate](https://npm.io/package/vee-validate.md) 4.15.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 4.15.1 (latest) — 2025-06-07
- 4.12.0-alpha.1 (alpha) — 2023-11-05
- 4.5.8 (next) — 2022-01-23
- 4.5.0-alpha.6 (edge) — 2021-08-31
- 4.5.0-alpha.2 (next-edge) — 2021-07-08
- 5.0.0-beta.1 — 2026-03-04
- 5.0.0-beta.0 — 2025-08-02
- 4.15.0 — 2024-12-22
- 4.14.7 — 2024-11-08
- 4.14.6 — 2024-10-26
- 4.14.5 — 2024-10-26
- 4.14.4 — 2024-10-23
- 4.14.3 — 2024-10-18
- 4.14.2 — 2024-10-18
- 4.14.1 — 2024-10-18
- … 119 more at https://npm.io/package/@vee-validate/rules/versions

## README

# @vee-validate/rules

<p align="center">
  <a href="https://vee-validate.logaretm.com/v4/guide/global-validators" target="_blank">
    <img width="150" src="https://github.com/logaretm/vee-validate/blob/main/logo.png">
  </a>
</p>

> Common Laravel-Like rules module for vee-validate

<p align="center">
  <a href="https://github.com/sponsors/logaretm">
    <img src='https://sponsors.logaretm.com/sponsors.svg'>
  </a>
</p>

## What's this

VeeValidate v4 breaks up the parts that made it a popular solution for form validation into it isolated parts. The core `vee-validate` package no longer includes the rules that came by default in previous releases, the built-in rules were rebranded as **global validators**,

This is where this package comes in, It includes the most common validators you will use in most of your applications, vee-validate allows you to express global rules just like Laravel's validation syntax.

## Installation

```sh
yarn add @vee-validate/rules

# or with npm
npm install @vee-validate/rules
```

## Usage

Use the `defineRule` function from `vee-validate` core library to add rules exported by this library:

```js
import { defineRule } from 'vee-validate';
import { required, email, min } from '@vee-validate/rules';

defineRule('required', required);
defineRule('email', email);
defineRule('min', min);
```

Or you can globally define all the available rules in the `@vee-validate/rules` package:

```js
import { defineRule } from 'vee-validate';
import * as rules from '@vee-validate/rules';

Object.keys(rules).forEach(rule => {
  defineRule(rule, rules[rule]);
});
```

### Available Rules

- alpha
- alpha_dash
- alpha_num
- alpha_spaces
- between
- confirmed
- digits
- dimensions
- email
- excluded
- ext
- image
- one_of
- integer
- is
- is_not
- length
- max
- max_value
- mimes
- min
- min_value
- numeric
- regex
- required
- required_if
- size

For more information about each rules, check the [documentation for global validators](https://vee-validate.logaretm.com/v4/guide/global-validators)

## Credits

- Inspired by Laravel's [validation syntax](https://laravel.com/docs/5.4/validation)

---
_Source: https://npm.io/package/@vee-validate/rules · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
