Stepper

API for stepper

API reference for Angular Material stepper

import {MatStepperModule} from '@angular/material/stepper';

Stepper data that is required for internationalization.

Properties
Name Description

changes: Subject<void>

Stream that emits whenever the labels here are changed. Use this to notify components if the labels have changed after initialization.

optionalLabel: string

Label that is rendered below optional steps.

Selector: [matStepLabel]

Selector: mat-step

Exported as: matStep
Properties
Name Description
@Input('aria-label')

ariaLabel: string

Aria label for the tab.

@Input('aria-labelledby')

ariaLabelledby: string

Reference to the element that the tab is labelled by. Will be cleared if aria-label is set at the same time.

@Input()

completed: boolean

Whether step is marked as completed.

@Input()

editable: boolean

Whether the user can return to this step once it has been marked as completed.

@Input()

errorMessage: string

Error message to display when there's an error.

@Input()

hasError: boolean

Whether step has an error.

@Input()

label: string

Plain text label of the step.

@Input()

optional: boolean

Whether the completion of step is optional.

@Input()

state: StepState

State of the step.

@Input()

stepControl: FormControlLike

The top level abstract control of the step.

content: TemplateRef<any>

Template for step content.

interacted: false

Whether user has seen the expanded step content or not.

stepLabel: MatStepLabel

Content for step label given by <ng-template matStepLabel>.

Methods
isErrorState

Custom error state matcher that additionally checks for validity of interacted form.

Parameters

control

FormControl

form

NgForm | FormGroupDirective

Returns
boolean

reset

Resets the step to its initial state. Note that this includes resetting form data.

select

Selects this step component.

Selector: [matStepper]

Properties
Name Description
@Input()

linear: boolean

Whether the validity of previous steps should be checked or not.

@Input()

selected: CdkStep

The step that is selected.

@Input()

selectedIndex: number

The index of the selected step.

@Output()

animationDone: EventEmitter<void>

Event emitted when the current step is done transitioning in.

@Output()

selectionChange: EventEmitter<StepperSelectionEvent>

Event emitted when the selected step has changed.

steps: QueryList<CdkStep>

The list of step components that the stepper is holding.

Methods
next

Selects and focuses the next step in list.

previous

Selects and focuses the previous step in list.

reset

Resets the stepper to its initial state. Note that this includes clearing form data.

Selector: mat-horizontal-stepper

Exported as: matHorizontalStepper
Properties
Name Description
@Input()

labelPosition: 'bottom' | 'end'

Whether the label should display in bottom or end position.

@Input()

linear: boolean

Whether the validity of previous steps should be checked or not.

@Input()

selected: CdkStep

The step that is selected.

@Input()

selectedIndex: number

The index of the selected step.

@Output()

animationDone: EventEmitter<void>

Event emitted when the current step is done transitioning in.

@Output()

selectionChange: EventEmitter<StepperSelectionEvent>

Event emitted when the selected step has changed.

steps: QueryList<CdkStep>

The list of step components that the stepper is holding.

Methods
next

Selects and focuses the next step in list.

previous

Selects and focuses the previous step in list.

reset

Resets the stepper to its initial state. Note that this includes clearing form data.

Selector: mat-vertical-stepper

Exported as: matVerticalStepper
Properties
Name Description
@Input()

linear: boolean

Whether the validity of previous steps should be checked or not.

@Input()

selected: CdkStep

The step that is selected.

@Input()

selectedIndex: number

The index of the selected step.

@Output()

animationDone: EventEmitter<void>

Event emitted when the current step is done transitioning in.

@Output()

selectionChange: EventEmitter<StepperSelectionEvent>

Event emitted when the selected step has changed.

steps: QueryList<CdkStep>

The list of step components that the stepper is holding.

Methods
next

Selects and focuses the next step in list.

previous

Selects and focuses the previous step in list.

reset

Resets the stepper to its initial state. Note that this includes clearing form data.

Button that moves to the next step in a stepper workflow.

Selector: button[matStepperNext]

Properties
Name Description
@Input()

type: string

Type of the next button. Defaults to "submit" if not specified.

Button that moves to the previous step in a stepper workflow.

Selector: button[matStepperPrevious]

Properties
Name Description
@Input()

type: string

Type of the previous button. Defaults to "button" if not specified.

Selector: mat-step-header

Properties
Name Description
@Input()

active: boolean

Whether the given step label is active.

@Input()

errorMessage: string

Error message to display when there's an error.

@Input()

iconOverrides: { [key: string]: TemplateRef<MatStepperIconContext>; }

Overrides for the header icons, passed in via the stepper.

@Input()

index: number

Index of the given step.

@Input()

label: MatStepLabel | string

Label of the given step.

@Input()

optional: boolean

Whether the given step is optional.

@Input()

selected: boolean

Whether the given step is selected.

@Input()

state: StepState

State of the given step.

Methods
focus

Focuses the step header.

Template to be used to override the icons inside the step header.

Selector: ng-template[matStepperIcon]

Properties
Name Description
@Input('matStepperIcon')

name: StepState

Name of the icon to be overridden.

templateRef: TemplateRef<MatStepperIconContext>

Template context available to an attached matStepperIcon.

Properties
Name Description

active: boolean

Whether the step is currently active.

index: number

Index of the step.

optional: boolean

Whether the step is optional.