Multi Step Nav
A multi step nav, also known as a wizard, is a determinate progress bar used in long processes that divides the main task into subtasks. The wizard lets the user quickly identify their current progress in completing the task and navigate forwards and backwards between steps if needed.
install | yarn add @clayui/multi-step-nav |
---|---|
version | 3.120.0 |
Stable3.120.0View in LexiconCHANGELOG
It's used when a major or big task has to be divided into smaller task, with the aim of letting the user breath in the process and providing them with a sense of progression.
Each step can have two different states: active
or complete
defined by props as you can see below.
State
Each step can have two different states: active
or complete
defined by props as you can see below.
The active state can be set using the active
property in the ClayMultiStepNav.Item
or ClayMultiStepNavWithBasicItems
component which defines the step index.
The complete
and error
states are defined using the state
property in the ClayMultiStepNav.Item
which defines whether the item is complete or has an error in the current state. The ClayMultiStepNavWithBasicItems
component follows the same API with the difference that it sets the state of the item to the current step which is set when using the active
or defaultActive
API.
Indicator position
Some use cases don't need the title or subtitle to add context to the steps, in those cases you might just want the label to be rendered to the top
of the indicator, so it can truncate the text if it is long.
<ClayMultiStepNav indicatorLabel="top">
<ClayMultiStepNav.Item
active={active}
complete={complete}
expand={i + 1 !== steps.length}
key={i}
>
<ClayMultiStepNav.Divider />
<ClayMultiStepNav.Indicator
complete={complete}
label={1 + i}
onClick={onClick}
subTitle={label}
/>
</ClayMultiStepNav.Item>
</ClayMultiStepNav>
Collapsable Steps
Using ClayMultiStepNavWithBasicItems
in combination with maxStepsShown
prop you can collapse the steps that don't fit into a dropdown to ensure good user experience.