Many components support user input validation with parameters that control the validation itself and the formatting on the control should validation fail. The configuration for validation is standard for all components.
In the following example, the input is expected to be a valid email address and is also required. Calling validate on the component instance will run the validation and return a boolean specifying whether it was successful. If not successful, the CSS class is-invalid will be added to the input.