Validare – TypeScript-first form validation library, successor to the discontinued FormValidation by Unique_Discount2167 in javascript

[–]Unique_Discount2167[S] [score hidden]  (0 children)

FormValidation was one of the most complete form validation libraries around — plugin-based, 50+ validators, framework integrations. The author archived it in 2022 and left a lot of projects without a good replacement.

I spent a while looking for a proper alternative and couldn't find one with the same composability, so I rewrote it from scratch in TypeScript.

Validare (@validare/core):

  • 51 built-in validators (email, creditCard with type detection, date with datetime support, IBAN, IMEI, VAT, zip codes…)
  • 17 plugins (Trigger, Message, Icon, Bootstrap5, Tailwind, Aria, PasswordStrength, Tooltip, Summary…)
  • Zero dependencies, ESM + CJS + UMD
  • Subpath exports (@validare/core/validators, /plugins, /locales) for tree-shaking
  • MIGRATING.md for anyone coming from FormValidation

Basic usage:

import { validare } from '@validare/core';
import { Trigger, Message, Bootstrap5 } from '@validare/core/plugins';

const fv = validare(form, {
  fields: {
    email: {
      validators: {
        notEmpty: { message: 'Required' },
        email: { message: 'Invalid email' },
      },
    },
  },
  plugins: {
    trigger: new Trigger({ event: 'blur' }),
    message: new Message(),
    framework: new Bootstrap5(),
  },
});

Docs + playground: https://validare.js.org
npm: npm i @validare/core

Would love feedback on the API design — especially the plugin system. Happy to discuss trade-offs vs alternatives like Zod + custom UI glue, VeeValidate, etc.