useFieldArray, these are a collection of simple functions that you can use to opt-in specific parts of vee-validate features like form state and various actions you can perform on fields and forms.
Here are a few examples of what you can build with these functions:
- A custom submission progress component
- A custom error message component.
- A form validity indicators
- reset buttons or submit buttons
Here is a list of the functions available that you can use:
useFieldErrorGives access to a single field’s first error message
useFormErrorsGives access to the entire error bag of the form
useIsFieldDirtyIf a field is dirty
useIsFormDirtyIf the form is dirty (form contains at least one dirty field)
useIsFieldTouchedIf a field is touched
useIsFormTouchedIf the form is touched (form contains at least one touched field)
useIsFieldValidIf a field is valid
useIsFormValidIf all fields are validated and valid
useValidateFieldReturns a function that validates a specific field
useValidateFormReturns a function that validates the entire form
useResetFormResets the form to its initial state
useSubmitFormCreates a submission function that validates and submits the form (even if no
formelement is involved)
useIsSubmittingIf the form is currently submitting
useIsValidatingIf the form is currently validating by validate function
useSubmitCountThe number of times the user attempted to submit the form
useFieldValueReturns a specific fields’ current value
useFormValuesReturns the current form field values
For more information about the functions, you can head over to the API reference and check them out.
For TypeScript users, it is imperative that they strongly type their form values and the their submissions. This guide will show you how to use either zod or yup with vee-validate's typed schema utilities to get the most out of your schemas with TypeScript.