New to Kendo UI for Angular? Start a free 30-day trial

Step Validation

The Stepper enables you to set validation logic for each of its steps.

Based on that logic, a success or error icon will be rendered for previous steps, that is, for steps whose index is less than the index of the current step. You can render validation icons either in the step indicator or as a part of the step label, depending on the current Stepper configuration options.

By default, the validation logic is executed only for previous steps.

Setup

To enable the step validation, configure the isValid option of the steps that has to be validated. It accepts both boolean and StepPredicateFn parameters.

Example
View Source
Edit In Stackblitz  
Change Theme:

Validation Logic

The Stepper enables you to specify custom validation logic for each step by providing a StepPredicateFn function for the isValid property of the step. This functionality is useful for scenarios where the validity of the step has to correspond to the state of some external content, for example, a form.

Example
View Source
Edit In Stackblitz  
Change Theme:

Controlling the Validation

By default, the Stepper validates only previous steps (whose index is less than the index of the current step). You can override this behavior by using the validate option of the steps. It accepts both boolean and StepPredicateFn parameters and allows you to have full control over which steps to validate and when.

If provided, a step will only be validated when its validate option is true. This allows the handling of specific scenarios such as validating certain steps only when a specific step is reached, validating all steps when the last step is reached, or even forcing the validation for future steps (that were previously visited by the user).

Example
View Source
Edit In Stackblitz  
Change Theme:

Triggering the Validation

As an addition to the validate option of the steps, the Stepper allows you to manually trigger the validation of the steps at any moment. To achieve this, invoke the validateSteps method of the component.

Steps that have their validate property set to false, will not be validated.

Example
View Source
Edit In Stackblitz  
Change Theme:

Custom Validation Icons

The Stepper allows you to customize the rendered validation icons. To achieve this, specify the successIcon and errorIcon properties of the Stepper, and provide the CSS classes that have to be applied to the icons.

Example
View Source
Edit In Stackblitz  
Change Theme: