Introduction
Create form instance
For this tutorial, we will start from a basic zodaf form example, to learn how to create a basic zodaf from, please refer to the Basic Usage guide.app/page.tsx
Basic Features
Customizing form fields
You can easily customize form fields by passing aconfig object to the useAutoForm function. The config can take the following properties:
Object that defines the form fields configuration. The key is the field name and the value is a See the configuration section for more details.
ZodafFieldConfig object.Example:Handling form events
Function that is called when the form is submitted. The function receives
the type-safe form data as an argument.Example:
Function that is called when the form has changes. The function receives
the type-safe form data as an argument.Example:
Label for the submit button.Example:Note: Ensure that the submitLabel is used with a submit component that
supports a children prop.
Hide the submit button.
Defaults to
false.Example:Component will render without a submit button.