Form Validation Validators

Validators are configurable functions used to check whether an input value matches a specific criteria.

There are several validation options that can be used in the validators field of the form field schema.

const { schema } = useForm<{ name: string; }>({
    name: {
        validators: [
            { name: 'required' },
            { name: 'minLength', value: 3 }
        ]
    }
});

Alpha Validator

Alphanumeric Validator

Email Validator

Min Validator

Max Validator

Min Length Validator

Max Length Validator

Number Validator

Required Validator

Same As Validator

Custom Validator