Reputation: 6452
How to remove the icons in the mat-step-icon using angular material.
I tried below:
<ng-template matStepperIcon="edit"></ng-template>
<ng-template matStepperIcon="done"></ng-template>
this works for edit and done state. want to change the default state as well. dont know what is the name to give.
can anyone help please?
thanks
Upvotes: 15
Views: 10919
Reputation: 347
On Angular Material v.14.1.3, you could add completed="false"
properties in <mat-step completed="false"></mat-step>
. the step icon will keep number index for selected step.
Upvotes: 5
Reputation: 503
From the docs, the possible values for matStepperIcon are
number | edit | done | error
So for default state, you'll want to use number
since you have edit
and done
covered.
You should end up with this:
<ng-template matStepperIcon="number"></ng-template>
Upvotes: 1
Reputation: 292
You can use this style in your css file of your angular project.
.yourParentDivCssClass ::ng-deep .mat-step-header .mat-step-icon {
display: none !important;
}
Upvotes: 1
Reputation: 463
You can use the following template to remove the icons from default state:
<ng-template matStepperIcon="done"></ng-template>
Upvotes: 1
Reputation: 474
Here is a simple workaround from the GitHub issue
@ViewChild(MatHorizontalStepper) stepper: MatHorizontalStepper;
ngAfterViewInit() {
this.stepper._getIndicatorType = () => 'number';
}
Upvotes: 24
Reputation: 31
if you want to remove all the icons on your material stepper one solution is to go to your styles.css
file and add the following:
.mat-step-header .mat-step-icon {
display: none !important;
}
This should do the trick
Upvotes: -2