docs(content): lint fix

This commit is contained in:
Benjamin Canac
2024-12-18 18:07:33 +01:00
parent f3f4edae28
commit 6974f23645
13 changed files with 60 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ It works with the [FormField](/components/form-field) component to display error
### Schema Validation
It requires two props:
- `state` - a reactive object holding the form's state.
- `schema` - a schema object from a validation library like [Zod](https://github.com/colinhacks/zod), [Yup](https://github.com/jquense/yup), [Joi](https://github.com/hapijs/joi), [Valibot](https://github.com/fabian-hiller/valibot) or [Superstruct](https://github.com/ianstormtaylor/superstruct).
@@ -73,6 +74,7 @@ Nested validation rules are handled using dot notation. For example, a rule like
Use the `validate` prop to apply your own validation logic.
The validation function must return a list of errors with the following attributes:
- `message` - the error message to display.
- `name` - the `name` of the `FormField` to send the error to.
@@ -91,6 +93,7 @@ props:
### Input Events
The Form component automatically triggers validation when an input emits an `input`, `change`, or `blur` event.
- Validation on `input` occurs **as you type**.
- Validation on `change` occurs when you **commit to a value**.
- Validation on `blur` happens when an input **loses focus**.