Skip to main content

CnStepper

The step indicator of a wizard: a numbered list of steps, with the finished ones ticked and the current one marked aria-current="step". CnWizardDialog and CnFormPage draw it, and an app can use it on its own page, such as a multi-step form laid out as the board draws it.

<CnStepper
:steps="[
{ id: 'audience', label: 'Audience' },
{ id: 'content', label: 'Content' },
{ id: 'send', label: 'Send' },
]"
:current-index="1"
allow-jump-back
@jump="goTo" />

With allowJumpBack, a finished step is a button that emits jump with its id. reachableIndex also keeps a step after the current one pressable once it was reached, so a person who stepped back can return to where they were.

Props​

PropTypeDefaultDescription
stepsArrayrequiredThe steps: { id, label }.
currentIndex (current-index)Number0Index of the current step.
allowJumpBack (allow-jump-back)BooleanfalseLet a finished step be pressed to go back to it.
reachableIndex (reachable-index)Number-1With allowJumpBack, the furthest step already reached: every step up to it other than the current one can be pressed. Unset, only the finished steps can.
lookStringundefinedThe look; unset follows the injected cnLook.
ariaLabel (aria-label)String'Steps'Accessible name of the list.
completedLabel (completed-label)String'completed'Visually hidden text after a finished step's label.

Events​

EventPayloadDescription
jumpthe step idA finished (or reached) step button was pressed.