npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kolirt/vue-validation-kit

v1.0.6

Published

A lightweight, Laravel-inspired validation package for Vue 3

Readme

A lightweight, Laravel-inspired validation package for Vue 3. Effortlessly validate complex, nested data structures with minimal code.

Table of Contents

Getting started

Advantages of using this solution

vue-validation-kit is a convenient and powerful package for data validation in Vue.js applications. It provides a simple and intuitive solution for form validation, inspired by the validation system of the Laravel framework, making it particularly user-friendly for developers familiar with this technology. The package allows seamless integration of validation into projects while keeping the code clean and structured.

🔥 Key benefits:

  • Ease of Use An intuitive syntax, similar to Laravel, enables quick setup of validation rules with minimal effort.
  • Flexibility Supports a wide range of built-in validation rules and offers the ability to create custom rules.
  • Efficiency Significantly reduces the amount of code required to implement validation, making projects easier to maintain.
  • Laravel-Inspired Developers working with Laravel will immediately recognize a familiar validation approach, simplifying the transition between frontend and backend.

🚀 Features:

One of the standout features of vue-validation-kit is its ability to validate deeply nested data structures without the need to write cumbersome code. The package makes it easy to handle complex objects and arrays, automatically applying validation rules to all levels of nesting. This is ideal for working with forms that contain multi-level data, such as objects with arrays or nested JSON structures.

With vue-validation-kit, you can focus on your application’s logic rather than tedious validation checks, while benefiting from a reliable and scalable tool for form handling in Vue.js.

Installation

Use yarn or npm to install the package @kolirt/vue-validation-kit.

npm install --save @kolirt/vue-validation-kit

yarn add @kolirt/vue-validation-kit

Setup

Add dependencies to your main.ts:

import { createApp } from 'vue'
import { createValidation } from '@kolirt/vue-validation-kit'
import { en } from '@kolirt/vue-validation-kit/localization'

const app = createApp({ ... })

app.use(createValidation({
  locale: 'en',
  messages: { en }
}))

app.mount('#app')

Usage

Validate field

<script setup lang="ts">
import { useForm, ValidationField, ValidationForm } from '@kolirt/vue-validation-kit'
import { required, min } from '@kolirt/vue-validation-kit/rules'
  
type Payload = {
  email: string
}

const form = useForm<Payload>(
  {
    name: null,
  },
  {
    name: [required(), min(3)]
  }
)

function send() {
  form.validate()
    .then(() => {
      console.log('Success validation')
    })
    .catch(() => {
      console.log('Error validation')
    })
}
</script>

<template>
  <ValidationForm @submit="send" :form="form">
    <ValidationField name="name" v-slot="{ fieldName, firstError }">
      <label :for="fieldName">{{ fieldName }}</label>
      <input :id="fieldName" :name="fieldName" type="text" v-model="form.payload.name"/>
      <div v-if="firstError">{{ firstError }}</div>
    </ValidationField>
  </ValidationForm>
</template>

Validate object

<script setup lang="ts">
import { useForm, ValidationField, ValidationForm } from '@kolirt/vue-validation-kit'
import { required, min } from '@kolirt/vue-validation-kit/rules'
  
type Payload = {
  city: {
    name: string
    lat: number
    lon: number
  }
}

const form = useForm<Payload>(
  {
    city: {
      name: null,
      population: null,
    }
  },
  {
    'city.name': [required(), min(3)],
    'city.population': [required()]
  }
)

function send() {
  form.validate()
    .then(() => {
      console.log('Success validation')
    })
    .catch(() => {
      console.log('Error validation')
    })
}
</script>

<template>
  <ValidationForm @submit="send" :form="form">
    <ValidationField name="city.name" v-slot="{ fieldName, firstError }">
      <label :for="fieldName">{{ fieldName }}</label>
      <input :id="fieldName" :name="fieldName" type="text" v-model="form.payload.city.name"/>
      <div v-if="firstError">{{ firstError }}</div>
    </ValidationField>

    <ValidationField name="city.population" v-slot="{ fieldName, firstError }">
      <label :for="fieldName">{{ fieldName }}</label>
      <input :id="fieldName" :name="fieldName" type="text" v-model="form.payload.city.population"/>
      <div v-if="firstError">{{ firstError }}</div>
    </ValidationField>
  </ValidationForm>
</template>

Rules

Presence and requirement

required

requiredIf

requiredIfAccepted

requiredIfDeclined

Value comparison

confirmed

same

is

greaterThan

greaterThanOrEqual

lessThan

lessThanOrEqual

Size and range

between

max

min

Data types

boolean

decimal

integer

Special formats

email

regex

url

List membership

included

notIncluded

Acceptance state

accepted

declined

Demo

Demo here

Example

Example here

FAQ

Check closed issues with FAQ label to get answers for most asked questions.

License

MIT

Other packages

Check out my other projects on my GitHub profile.