Stepper

API for stepper

API reference for Angular CDK stepper

import {CdkStepperModule} from '@angular/cdk/stepper';

Selector: cdk-step

Exported as: cdkStep
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: CdkStepLabel

Template for step label if it exists.

Methods
reset

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

select

Selects this step component.

Selector: [cdkStepper]

Exported as: cdkStepper
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()

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: [cdkStepLabel]

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

Selector: button[cdkStepperNext]

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[cdkStepperPrevious]

Properties
Name Description
@Input()

type: string

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

Selector: [cdkStepHeader]

Methods
focus

Focuses the step header.

Change event emitted on selection changes.

Properties
Name Description

previouslySelectedIndex: number

Index of the step previously selected.

previouslySelectedStep: CdkStep

The step instance previously selected.

selectedIndex: number

Index of the step now selected.

selectedStep: CdkStep

The step instance now selected.

Configurable options for stepper.

Properties
Name Description

displayDefaultIndicatorType: boolean

Whether the stepper should display the default indicator type or not. Default behavior is assumed to be true.

showError: boolean

Whether the stepper should display an error state or not. Default behavior is assumed to be false.

Position state of the content of each step in stepper that is used for transitioning the content into correct position upon step selection change.

type StepContentPositionState = 'previous' | 'current' | 'next';

Possible orientation of a stepper.

type StepperOrientation = 'horizontal' | 'vertical';

The state of each step.

type StepState = 'number' | 'edit' | 'done' | 'error' | string;

Enum to represent the different states of the steps.

const STEP_STATE: { NUMBER: string; EDIT: string; DONE: string; ERROR: string; };

InjectionToken that can be used to specify the global stepper options.

const STEPPER_GLOBAL_OPTIONS: InjectionToken<StepperOptions>;
Deprecated

InjectionToken that can be used to specify the global stepper options.

const MAT_STEPPER_GLOBAL_OPTIONS: InjectionToken<StepperOptions>;