diff --git a/docs/framework/react/guides/validation.md b/docs/framework/react/guides/validation.md index 158261b3dc..f470b99024 100644 --- a/docs/framework/react/guides/validation.md +++ b/docs/framework/react/guides/validation.md @@ -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 ( +
+ { + return <>{/* ... */} + }} + /> +
+ ) +} +``` + Async validators at the form- and field-level are supported as well: ```tsx