use-form schema
use-form schema validation with zod, yup and joi
Source
Docs
Package
Getting started
@mantine/form supports schema validation with zod, joi and yup out of the box.
You will need to install one of the libraries yourself, as @mantine/form package does not depend on any of them.
If you do not know what validation library to choose, we recommend choosing zod
as the most modern and developer-friendly library.
zod
Install zod:
Then create schema and wrap it with zodResolver exported from @mantine/form:
Yup
Install yup:
Then create schema and wrap it with yupResolver exported from @mantine/form:
Joi
Install joi:
Then create schema and wrap it with joiResolver exported from @mantine/form: