<Formiz> component
Import
Props
onSubmit(values)
Triggered when the form is submitted.
onValidSubmit(values)
Triggered when the form is valid and submitted.
onInvalidSubmit(values)
Triggered when the form is invalid and submitted.
onChange(values)
Triggered every time the form changes.
⚠️ This is triggered when each field is mounted.
ℹ️ Instead you can get values
of the form with the useForm() hook.
onValid()
Triggered when the form is valid.
ℹ️ Instead you can get isValid
value with the useForm() hook.
onInvalid()
Triggered when the form is invalid.
ℹ️ Instead you can get isValid
value with the useForm() hook.
autoForm
Set to true
to auto add a <form>
element with auto onSubmit.
ℹ️ Instead you can get the submit()
method with the useForm() hook and use it with your own <form>
element.
id
Allows you to pass a custom id will be used to create the ids of the fields. By default, it is generated automatically. But for SSR rendering like in NextJS, you may want to replace the automatically generated identifiers by a predictable id.
initialValues
Allows you to pass some initial values to the form. If a field is mounted, it will lookup into this object to set his initial value.
This is usefull when you getting data from an API like an edit page.
You can use nested objects and arrays.
connect
Allow you to connect your form with the useForm() hook.
See useForm() documentation for more details