Implement Alternative labels in Stepper component
Bug, feature request, or proposal:
Feature request
What is the expected behavior?
Add an ability to display labels below step number. See the "Alternative labels" section on https://material.io/guidelines/components/steppers.html#steppers-types-of-steppers
What is the current behavior?
Apparently, placing labels under step numbers is not currently supported in Angular Material. At least, I didn't find anything in the docs.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 2+, All browsers
Do we have any update on this or any temporary fix to make it work. I want to place the labels below the step number.
Here is my workaround:
-
on xs devices I hide the labels as they don't fit anyways

-
on sm devices I did my best to follow the official guidelines.

I couldn't figure out how to to make the lines in between go 8px right next to the icons, any contributions are welcome.
Also I didn't do anything for optional labels.
@media (max-width: 479px) {
.mat-horizontal-stepper-header .mat-step-icon, .mat-horizontal-stepper-header .mat-step-icon-not-touched {
margin-right: 0 !important;
}
.mat-step-label {
display: none !important;
}
}
@media (min-width: 480px) and (max-width: 767px) {
.mat-stepper-horizontal {
padding-left: 8px;
padding-right: 8px;
}
.mat-horizontal-stepper-header {
flex-direction: column;
flex: 1;
height: 104px !important;
padding-left: 16px !important;
padding-right: 16px !important;
}
.mat-horizontal-stepper-header .mat-step-icon,
.mat-horizontal-stepper-header .mat-step-icon-not-touched {
margin-top: 24px;
margin-right: 0 !important;
}
.mat-step-label {
margin-top: 16px;
width: 100%;
}
.mat-step-text-label {
text-align: center;
}
.mat-stepper-horizontal-line {
margin-top: -32px !important;
max-width: 32px;
}
}
@philip-firstorder-io : Can you share your html file for the same? This isn't working for me.
@philip-firstorder You can use negative margins to bring the horizontal line closer to where you want them.
.mat-stepper-horizontal-line { border-top-width: 2px !important; margin: -38px -60px 0 -60px !important; }

Please don't forget ::ng-deep, e.g.
::ng-deep .mat-step-header {
border-radius: 50%;
}
We added support for this a couple of major versions ago. Closing this issue.
https://material.angular.io/components/stepper/overview#label-position
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.