1

I am using angular 8.2.4 and horizontal mat-stepper. I have customized the icons in each step and I do not need to show the 'tick' icon (which corresponds to the done state) once each and every step is visited. This is how it looks like now. enter image description here

`<mat-horizontal-stepper #stepper [linear]="true" class="register-stepper">
          <!--<ng-template matStepperIcon="done">
            <mat-icon>done</mat-icon>
          </ng-template>-->
         <ng-template matStepperIcon="user">
                  <mat-icon>account_circle</mat-icon>
         </ng-template>
         <mat-step [completed]="true" state="user">
                  <ng-template class="form-control" matStepLabel>Basic</ng-template>
                  <h4 class="cgg-component-heading">Basic Information</h4>                  
                </mat-step>
        </mat-horizontal-stepper>`

I have already removed the matStepperIcon="done".

How can I avoid this done state's icon displaying and keep the custom default icon as it is without showing the 'tick' icon?

SMash
  • 345
  • 2
  • 7
  • 23

2 Answers2

0

Add empty edit state It will override default behaviour

Try this:

<ng-template matStepperIcon="edit">
</ng-template>
Chellappan வ
  • 23,645
  • 3
  • 29
  • 60
0

Need a bit more clarity, on what you mean by default icon. From your image above I'm assuming you want the "account_circle" icon on all of your steps. In that case, the below code would work.

<!-- START - Material Stepper  -->
<mat-horizontal-stepper>
    <!-- Icon overrides. -->
    <ng-template matStepperIcon="edit">
        <mat-icon>account_circle</mat-icon>
    </ng-template>
    <ng-template matStepperIcon="active">
        <mat-icon>account_circle</mat-icon>
    </ng-template>
    <ng-template matStepperIcon="done">
        <mat-icon>account_circle</mat-icon>
    </ng-template>
    <ng-template matStepperIcon="number">
        <mat-icon>account_circle</mat-icon>
    </ng-template>
</mat-horizontal-stepper>
<!-- END - Material Stepper  -->

Just replace the state with whichever icon you want. Unless you explicitly replace the state, your icon would not be used by material stepper.

Evan MJ
  • 1,967
  • 13
  • 16