Create form instance
To create a form instance, use theuseAutoForm function from @zodaf/react package. The createForm function accepts two arguments:
schema: A zod schema object that defines the form fields and validation rules.config: An object that defines the form configuration. This is optional.
app/page.tsx
Rendering form
To render the form, use theAutoForm component from @zodaf/react package. The AutoForm component accepts the form instance as a prop.
app/page.tsx
Full code
app/page.tsx
Result
