Skip to content

๐Ÿ“ Typescript first model-based form validation library for Vue 3

License

Notifications You must be signed in to change notification settings

victorgarciaesgi/regle

Repository files navigation

regle cover

npm version npm download npm download

Regle

Regle \สษ›ษกl\ (French word for 'rule' ) is a Typescript-first model-based form validation library for Vue 3. It's heavily inspired by Vuelidate.

โš ๏ธ Project is still in development, do not use it in production API or function names can still change

๐Ÿ“š Documentation

Documentation

๐Ÿงฐ Features

  • โœ… Typescript first
  • ๐Ÿค– 100% type inference
  • ๐Ÿ“– Model based validation
  • ๐Ÿฆธโ€โ™‚๏ธ Zod support
  • ๐Ÿชถ Light (~6kb gzip)
  • ๐Ÿ›’ Collection validation

๐ŸŽฎ Play with it

TODO

๐Ÿ”Œ Compatibility:

  • <script xmlns=""/> Vue 3.1+
  • Nuxt 3
  • <script xmlns=""/> Pinia

โ˜‘๏ธ Roadmap

  • Async rules
  • resetAll
  • validateState typesafe
  • Deep nested rules
  • Collection validation
  • applyIf helper (like requiredIf for any rule)
  • Async with params (need deps array) (withAsync)
  • Options (lazy, rewardEarly, autoDirty)
  • Regex helper
  • Additional rules and "and" helper
  • "or" and "not" helper
  • externalErrors
  • Dates built-in rule
  • Usable Metadata
  • Zod support
  • Per field validation option (lazy, debounce, etc...)
  • Logo
  • $silentErrors
  • Validation groups
  • Documentation (in progress)
  • Unit tests (in progress)
  • E2E tests (in progress)
  • Nuxt Module
  • withErrorType
  • Issue template
  • Valibot support
  • TS docs

Maybe in roadmap

  • Typed plugin system (like scrollToError)

Quick install

pnpm install @regle/core @regle/rules
# or
yarn add @regle/core @regle/rules
# or
npm install @regle/core @regle/rules

๐Ÿ“‘ License

MIT License