<p align="center">
  <img src="https://raw.githubusercontent.com/victorgarciaesgi/regle/master/.github/images/regle-github-banner.png" alt="regle cover">
</p>

<a href="https://www.buymeacoffee.com/victorgarco" target="_blank"><img height="40" width="150" src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 40px !important;width: 150px !important;" ></a>

# Regle

Regle \ʁɛɡl\ (French word for 'rule') is a Typescript-first model-based validation library for Vue 3.
It's heavily inspired by Vuelidate.

## 📚 Documentation

[![Documentation](https://raw.githubusercontent.com/victorgarciaesgi/regle/refs/heads/main/.github/images/redirectDoc.svg)](https://reglejs.dev/)

## 🎮 Play with it

| Playground                                                                                                                                                                                           | Simple demo                                                                                                                                                                                                                                                             | Advanced Demo                                                                                                                                                                                                                                                                 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a target='_blank' href="https://play.reglejs.dev"><img width="180" src="https://raw.githubusercontent.com/victorgarciaesgi/regle/refs/heads/main/.github/images/regle-playground-button.svg" /></a> | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/simple-example?file=examples/simple-example/src/App.vue&configPath=examples/simple-example) | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/advanced-example?file=examples/advanced-example/src/App.vue&configPath=examples/advanced-example) |

## ✨ Features

- 🔌 **Headless**: Plug any UI or markup to the validation.
- 🎯 **Type safe**: Full inference and autocompletion support.
- 🌳 **Model based**: Your validation tree structure matches the data model.
- 🎨 **Style Agnostic**: Works with any CSS framework or plain CSS.
- 📦 **Modular design**: Expand Regle properties or default validation rules.
- 🔄 **Async validation**: Handle asynchronous validations and pending states with ease.
- 🌐 **i18n Ready**: Works with any i18n library.
- 📕 **Vuelidate like API**: Regle's API mimics Vuelidate's API while improving it on a lot of areas.
- ⚡️ **SSR Ready**: Full support for Server Side Rendering environments.
- ✅ **Alternative validation**: [Standard Schema](https://standardschema.dev/) spec validation support.
  - 🦸‍♂️ [Zod](https://zod.dev/)
  - 🤖 [Valibot](https://valibot.dev/)
  - 🚢 [ArkType](https://arktype.io)
