Aside from useField and useForm and 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 messageuseFormErrorsGives access to the entire error bag of the formuseIsFieldDirtyIf a field is dirtyuseIsFormDirtyIf the form is dirty (form contains at least one dirty field)useIsFieldTouchedIf a field is toucheduseIsFormTouchedIf the form is touched (form contains at least one touched field)useIsFieldValidIf a field is validuseIsFormValidIf all fields are validated and validuseValidateFieldReturns a function that validates a specific fielduseValidateFormReturns a function that validates the entire formuseResetFormResets the form to its initial stateuseSubmitFormCreates a submission function that validates and submits the form (even if noformelement is involved)useIsSubmittingIf the form is currently submittinguseIsValidatingIf the form is currently validating by validate functionuseSubmitCountThe number of times the user attempted to submit the formuseFieldValueReturns a specific fields’ current valueuseFormValuesReturns the current form field values
For more information about the functions, you can head over to the API reference and check them out.
Next Step
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.