Validation rules

FormFusion extends the standard list of native input types

 with a large collection of rules that define and apply a corresponding validation pattern to the input field. You only need to pass the preffered type prop to the input and  FormFusion takes care of everything.

There are two ways to apply a validation rule to a field:

1. By passing down the name of the validation rule as the type property:




2. By importing the preferred validation rule and passing it down as the type property. This should be the default approach when using dynamic validation rules or when using some of the formfusion's validation sets.





Currently, FormFusion includes 62 generic validation rules. To use some of the more specific validation rules, you'll need to install the corresponding package.



List of available sets of validation rules:
@formfusion/postcodes
@formfusion/licence-plates
@formfusion/iban
@formfusion/passports
@formfusion/phones
@formfusion/tin
@formfusion/vat