Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/framework/react/guides/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,37 @@ function App() {
}
```

Here is the same example with Valibot:

```tsx
import * as v from 'valibot'

const userSchema = v.object({
age: v.pipe(v.number(), v.minValue(13, 'You must be 13 to make an account')),
})

function App() {
const form = useForm({
defaultValues: {
age: 0,
},
validators: {
onChange: userSchema,
},
})
return (
<div>
<form.Field
name="age"
children={(field) => {
return <>{/* ... */}</>
}}
/>
</div>
)
}
```

Async validators at the form- and field-level are supported as well:

```tsx
Expand Down
Loading