I built vue-uform – a unstyled, component-driven form validation library for Vue 3

posted 1 min read

Hey everyone

I’ve been working on a Vue 3 form library called vue-uform, and I think it might be useful for folks who want flexible, unstyled, component-driven form validation without the boilerplate.

Why I built it

Most form libraries either:

  • Come with a bunch of built-in styles that don’t match your design system, or
  • Require too much JS/TS setup for simple forms.

vue-uform takes a different approach:

  • No built-in styles – you have full control over HTML & CSS.
  • Treats components as first-class citizens – validation, data flow, and UI are all component-based.
  • Works with any UI library (Element Plus, Naive UI, etc.).
  • Supports built-in & custom validation rules (inspired by FormKit).

Quick Example

<script setup>
const formValues = { username: '', password: '' }

function doLogin(data) {
  console.log(data)
}
</script>
<template>
  <u-form :values="formValues" @submit="doLogin">
    <u-field name="username" label="Username" validation="required" v-slot="{ value, update }">
      <input f-model />
    </u-field>

    <u-field name="password" label="Password" validation="required|min:6" v-slot="{ value, update }">
      <input type="password" f-model />
    </u-field>

    <u-submit>Login</u-submit>
  </u-form>
</template>

That f-model directive is provided by a small Vite plugin – it’s like v-model but tailored for form fields.

✅ Built-in validation rules include:

required, number, email, between, starts_with, url, and more – you can also add your own custom rules with parameters

Example custom rule:

<script setup lang="ts">
function isfruit(node: FieldNode): boolean | string {
  const { value } = node;
  if (value.value != "apple" && value.value != "banana") {
    return "this value is not apple or banana";
  }
  return true;
}
</script>
<template>
    <u-field
      name="fruit"
      label="Fruit"
      help="please input a fruit"
      :rules="{ isfruit }"
      validation="required|isfruit"
      v-slot="{ value, update }"
    >
      <input f-model />
    </u-field>
</template>

Installation

pnpm install vue-uform
pnpm install @vue-uform/vite-plugin -D

Links

GitHub: https://github.com/tu6ge/vue-uform

StackBlitz: https://stackblitz.com/~/github.com/tu6ge/vue-uform-example

If you read this far, tweet to the author to show them you care. Tweet a Thanks
0 votes
0 votes
0 votes

More Posts

Why did I create vue-uform

tu6ge - Aug 20

How I Built a Smart Elevator Control System in Vue 3 and TypeScript

Toni Naumoski - Jun 19

How I Started Writing Unit Tests for Vue Components

ByteMinds - Mar 29

How to apply various postprocessing effects like Bloom, Motion Blur, and Pixelation inside a Vue

Sunny - Jul 6

Turn Your Vue Web App into a Mobile App (Android & iOS) in Just 5 Minutes

Toni Naumoski - Jun 23
chevron_left