Currently the icon for completed step is 'create'. How can I change it to some other material icon line, like 'Done' ?
<mat-vertical-stepper>
<mat-step label="Agreement Preparation">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
<mat-step label="Ready for Biometric">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
<mat-step label="Document in Submission">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
</mat-vertical-stepper>
There does not seem to be option to change color of mat stepper icon, you can use this css as workaround. Custom theme class can be used across application,just wrapp any material component and use color attribute primary,accent or warn as defined in class.
For each mat-step , the stepControl attribute can be set to the top level AbstractControl that is used to check the validity of the step. There are two possible approaches. One is using a single form for stepper, and the other is using a different form for each step.
There are three main types of stepper motors: Permanent magnet stepper. Variable reluctance stepper. Hybrid synchronous stepper.
The current version of the Material library supports this functionality. (5.2.3+)
Simply include an ng-template
that defines your custom icon, and indicate which original icon ('edit' or 'done') you're replacing. The format looks like this:
<ng-template matStepperIcon="edit">
<mat-icon>face</mat-icon>
</ng-template>
Here, I've replace the 'edit' icon with the material icon for 'face'. (This is a very distinctive icon I used for testing purposes.)
This ng-template
goes inside the mat-vertical-stepper
or mat-horizontal-stepper
.
So, for your example, if you wanted to replace the 'edit' icon with the material icon for 'done', you would do like so:
<mat-vertical-stepper>
<ng-template matStepperIcon="edit">
<mat-icon>done</mat-icon>
</ng-template>
<mat-step label="Agreement Preparation">
<p>Agreement prepariaton is initiated by our side </p>
</mat-step>
<mat-step label="Ready for Biometrics">
<p>Agreement preparation is initiated by our side </p>
</mat-step>
<mat-step label="Document in Submission">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
</mat-vertical-stepper>
Here is a StackBlitz example showing this in action.
MatStep has property editable which blocks the step and sets the tick icon "done" to the step header. Run this line once the step is complete:
this.stepper.selected.editable = false;
How to set a step to done having the form unlocked I do not know, but it kind of make sense to indicate that the step is done/complete and lock it. You can again unlock it using editable = true, .next() or .previous() functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With