Template in Angular Stepper component
27 Apr 20244 minutes to read
The Stepper component allows you to customize the default appearance and content of each step, creating a personalized experience for the user. You can use the template propety to set the template content for the steps.
The step model and current step index are passed as step
and currentStep
properties in the template context for customization.
import { Component } from "@angular/core";
@Component({
imports: [ StepperAllModule, StepperModule ],
standalone: true,
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
<div class="default-stepper-section">
<ejs-stepper id="stepperTemplate" activeStep="1" [template]="template">
<e-steps>
<e-step label="PowerPoint" iconCss="sf-icon-powerpoint"></e-step>
<e-step label="Presentation" iconCss="sf-icon-projector"></e-step>
<e-step label="Backup" iconCss="sf-icon-onedrive"></e-step>
</e-steps>
<ng-template #template let-data="">
<div class="template-content">
<span class=""></span><br>
<span class="e-label"></span>
</div>
</ng-template>
</ejs-stepper>
</div>
.template-content {
background: #fff;
width: 65px;
}
/* Stepper progressbar customization */
#stepperTemplate.e-stepper .e-stepper-progressbar {
height: 3px;
top: 25px;
}
#stepperTemplate.e-stepper .e-stepper-progressbar .e-progressbar-value {
background-color: #27d96d;
}
/* Stepper status customization */
#stepperTemplate .e-step-completed * {
color: #19cd60;
}
#stepperTemplate .e-step-inprogress * {
color: #3479f3;
}
#stepperTemplate .e-step-notstarted * {
color: #bdbdbd;
}
@font-face {
font-family: 'template';
src:
url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMj1tSfUAAAEoAAAAVmNtYXDnE+dkAAABlAAAADxnbHlm39zzMQAAAdwAAAacaGVhZCaImHMAAADQAAAANmhoZWEIUQQGAAAArAAAACRobXR4FAAAAAAAAYAAAAAUbG9jYQR8BVAAAAHQAAAADG1heHABFwEbAAABCAAAACBuYW1ldkXdggAACHgAAAKRcG9zdD2fuhIAAAsMAAAAXwABAAAEAAAAAFwEAAAAAAAD9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hAHQAZQBfAHUAcABkAGEAdABlAGQAdABlAG0AcABsAGEAdABlAF8AdQBwAGQAYQB0AGUAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAdABlAG0AcABsAGEAdABlAF8AdQBwAGQAYQB0AGUAZABGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIAB1AHMAaQBuAGcAIABTAHkAbgBjAGYAdQBzAGkAbwBuACAATQBlAHQAcgBvACAAUwB0AHUAZABpAG8AdwB3AHcALgBzAHkAbgBjAGYAdQBzAGkAbwBuAC4AYwBvAG0AAAAAAgAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAQIBAwEEAQUBBgANcHJvamVjdG9yLW9sZApwb3dlcnBvaW50CG9uZWRyaXZlDXByb2plY3Rvci1uZXcAAAA=) format('truetype');
font-weight: normal;
font-style: normal;
}
#stepperTemplate [class^="sf-icon-"], #stepperTemplate [class*=" sf-icon-"] {
font-family: 'template' !important;
speak: none;
font-size: 40px;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
#stepperTemplate .sf-icon-projector:before { content: "\e700"; }
#stepperTemplate .sf-icon-powerpoint:before { content: "\e701"; }
#stepperTemplate .sf-icon-onedrive:before { content: "\e702"; }
.default-stepper-section {
width: 75%;
margin: 0px auto;
min-width: 85px;
padding: 25px 0;
}