Angular Stepper - Configure a Read-Only Stepper

You can disable all user interaction with Stepper by setting focusStateEnabled to false and assigning the pointer-events: none; CSS style to the component. Define and modify the selectedIndex property to control the Stepper state independently of the component. The code snippet below allows users to change the active step with two Buttons.

app.component.html
app.component.ts
app.component.css
  • <dx-stepper
  • id="stepper"
  • [dataSource]="dataSource"
  • [selectedIndex]="selectedIndex"
  • [focusStateEnabled]="false"
  • >
  • </dx-stepper>
  • <dx-button text="Previous Step" (onClick)="handlePreviousButtonClick()"></dx-button>
  • <dx-button text="Next Step" (onClick)="handleNextButtonClick()"></dx-button>
  • // ...
  • export class AppComponent {
  • selectedIndex: number = 0;
  • handlePreviousButtonClick() {
  • if (this.selectedIndex > 0) {
  • this.selectedIndex -= 1;
  • }
  • }
  • handleNextButtonClick() {
  • if (this.selectedIndex < this.dataSource.length - 1) {
  • this.selectedIndex += 1;
  • }
  • }
  • }
  • #stepper {
  • pointer-events: none;
  • }