Core Regle form validation in Vue 3 — setup with `useRegle`, the reactive `r$` object, validation properties, displaying errors, and modifiers. Use when adding or editing Regle forms, binding `v-model` to `r$.$value`, or reading `$error`/`$errors`/`$invalid`/`$validate`/`$reset`. For validation rules see regle-rules; for advanced patterns see regle-advanced.
74
93%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Regle is a type-safe, model-based, headless form validation library for Vue 3. It provides full TypeScript inference, reactive validation, and works with any UI framework or design system.
Regle provides an MCP server that can be used to get documentation and autocomplete for Regle. If it's available, use it to get up-to-date information on the API.
{
"mcpServers": {
"regle": {
"command": "npx",
"args": ["@regle/mcp-server"]
}
}
}
## Installation
```sh
# Core + built-in rules
pnpm add @regle/core @regle/rules
# Optional: schema support (Zod, Valibot, ArkType)
pnpm add @regle/schemasRequires Vue 3.3+ and TypeScript 5.1+.
import { useRegle } from '@regle/core';
import { required, email, minLength } from '@regle/rules';
const { r$ } = useRegle(
{ name: '', email: '' },
{
name: { required, minLength: minLength(3) },
email: { required, email },
}
);<template>
<input v-model="r$.$value.name" placeholder="Name" />
<ul v-if="r$.$errors.name.length">
<li v-for="error of r$.$errors.name" :key="error">{{ error }}</li>
</ul>
<button @click="r$.$validate()">Submit</button>
</template>reactive, ref, or single valuer$: returned reactive object with values, errors, dirty state, and validation methodsrequired to enforce a field| Topic | Description | Reference |
|---|---|---|
| useRegle | State definition, rules declaration, dynamic rules, r$ object | core-use-regle |
| Validation Properties | $invalid, $dirty, $error, $errors, $pending, $validate, $touch, $reset | core-validation-properties |
| Displaying Errors | Showing errors, custom messages, getErrors, flatErrors | core-displaying-errors |
| Modifiers | autoDirty, lazy, silent, rewardEarly, disabled, validationGroups, per-field modifiers | core-modifiers |
createRule), rule wrappers (withMessage, withParams, withAsync), and rule operators (and, or, applyIf, assignIf).008232b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.