Steps

Steps is a navigation bar that guides users through the steps of a task.

When To Use#

When the task is complicated or has a certain sequence in the series of subtasks, we can decompose it into several steps to make things easier.

import { NzStepsModule } from 'ng-zorro-antd/steps';

Examples

Finished
This is a description.
2
In Progress
Left 00:00:08
This is a description.
3
Waiting
This is a description.

The most basic step bar.

expand codeexpand code
      Loading...
    
Finished
2
In Progress
3
Waiting

By setting like this: <nz-steps nzSize="small">, you can get a mini version.

expand codeexpand code
      Loading...
    
4
Finished
5
In Progress
6
Waiting

By setting nzStartIndex to change starting index of a step component. Be sure to add an offset to nzCurrent as well.

expand codeexpand code
      Loading...
    
Login
Verification
Pay
Done

You can use your own custom icons by setting the property nzIcon for nz-step. Old API is still compatible but we strongly suggest the new API.

expand codeexpand code
      Loading...
    
1
Finished
2
In Progress
3
Waiting
First-content

Cooperate with the content and buttons, to represent the progress of a process.

expand codeexpand code
      Loading...
    
Finished
This is a description.
2
In Progress
This is a description.
3
Waiting
This is a description.

A simple step bar in the vertical direction.

expand codeexpand code
      Loading...
    
Finished
This is a description.
2
In Progress
This is a description.
3
Waiting
This is a description.

A simple mini version step bar in the vertical direction.

expand codeexpand code
      Loading...
    
Finished
This is a description.
In Progress
This is a description.
3
Waiting
This is a description.

By using nzStatus of nz-steps, you can specify the state for current step.

expand codeexpand code
      Loading...
    
Finished
This is a description.
In Progress
This is a description.
Waiting
This is a description.
Finished
This is a description. This is a description.
Finished
This is a description. This is a description.
In Progress
This is a description. This is a description.
Waiting
This is a description.
Waiting
This is a description.

Steps with progress dot style.

expand codeexpand code
      Loading...
    
Finished
You can hover on the dot.
In Progress
You can hover on the dot.
Waiting
You can hover on the dot.
Waiting
You can hover on the dot.

You can customize the display for Steps with progress dot style.

expand codeexpand code
      Loading...
    
1
Finished
This is a description.
2
In Progress
This is a description.
3
Waiting
This is a description.
1
Finished
This is a description.
2
In Progress
This is a description.
3
Waiting
This is a description.

subscribe (nzIndexChange) makes Steps clickable.

expand codeexpand code
      Loading...
    
Step 1
00:00:05
This is a description.
2
Step 2
00:01:02
This is a description.
3
Step 3
waiting for long long time
This is a description.
Step 1
2
Step 2
3
Step 3
4
Step 4
finish 1
finish 2
3
current process
4
wait

Navigation steps.

expand codeexpand code
      Loading...
    
1
Step 1
This step is synchronous.
2
Step 2
This step is asynchronous.
3
Step 3
This step is asynchronous.

Asynchronous steps with circular progress bar.

expand codeexpand code
      Loading...
    

API#

<nz-steps>
  <nz-step nzTitle="first step"></nz-step>
  <nz-step nzTitle="second step"></nz-step>
  <nz-step nzTitle="third step"></nz-step>
</nz-steps>

nz-steps#

The whole of the step bar.

PropertyDescriptionTypeDefault
[nzType]type of steps, can be set to one of the following values: default, navigation'default' | 'navigation'default
[nzCurrent]To set the current step, counting from 0. You can overwrite this state by using nzStatus of nz-stepnumber0
[nzDirection]To specify the direction of the step bar, horizontal and vertical are currently supported'vertical' | 'horizontal'horizontal
[nzLabelPlacement]Support vertical title and description'vertical' | 'horizontal'horizontal
[nzProgressDot]Steps with progress dot style, customize the progress dot by setting it with TemplateRefboolean | TemplateRef<{ $implicit: TemplateRef<void>, status: string, index: number }>false
[nzSize]To specify the size of the step bar, default and small are currently supported'small' | 'default''default'
[nzStatus]To specify the status of current step, can be set to one of the following values: waitprocessfinisherror'wait' | 'process' | 'finish' | 'error''process'
[nzStartIndex]To specify the starting numbernumber0
(nzIndexChange)Trigger event when step clicknumber-

nz-step#

A single step in the step bar.

PropertyDescriptionTypeDefault
[nzDescription]description of the step, optional propertystring | TemplateRef<void>-
[nzIcon]icon of the step, optional propertystring | string[] | Set<string> | { [klass: string]: any; }TemplateRef<void>
[nzStatus]to specify the status. It will be automatically set by nzCurrent of nz-steps if not configured. Optional values are: waitprocessfinisherror'wait' | 'process' | 'finish' | 'error''wait'
[nzTitle]title of the stepstring | TemplateRef<void>-
[nzSubtitle]subTitle of the stepstring | TemplateRef<void>-
[nzDisabled]disable clickbooleanfalse
[nzPercentage]Progress percentage of the step in process status (only works on basic Steps)number-