Newer Version Available

This content describes an older version of this product. View Latest

Display Flow Stages by Wrapping a Progress Indicator

If you’re tracking stages in your flow, display them at runtime by creating a custom component that wraps a progress indicator with the lightning:flow component. Use the progress indicator to display the flow’s active stages and current stage, and use the lightning:flow component to display the flow’s screens. To pass the flow’s active stages and current stage to the progress indicator, use the lightning:flow component's onstatuschange action.

Example

This c:flowStages_global component uses lightning:progressindicator to display the flow’s stages and lightning:flow to display the flow.

This example only applies to flows that have active stages.

Note

A component that displays a flow's stages above the flow.

c:flowStages_global Component

c:flowStages_global Design

The design resource includes the flowName attribute, so you can specify which flow to start from Lightning App Builder.

c:flowStages_global Style

c:flowStages_global Controller

The controller uses the flowName attribute to determine which flow to start.

Each time a new screen loads, the onstatuschange action fires, giving the controller access to a handful of parameters about the flow. The currentStage and activeStages parameters return the labels and names of the relevant stages.

When onstatuschange fires in this component, it calls the controller's statusChange method. That method passes the flow's currentStage and activeStages parameters into the component's attributes. For each item in the activeStages attribute, the method adds a lightning:progressStep component to the component markup.