A progress trail through a sequence of steps. The stepper owns which step is
current and which are finished; each step renders the state it is handed.
Your details
Where to send it
How to pay
Show code Copy < nana-stepper current = "1" >
< nana-stepper-step label = "Account" >Your details</ nana-stepper-step >
< nana-stepper-step label = "Address" >Where to send it</ nana-stepper-step >
< nana-stepper-step label = "Payment" >How to pay</ nana-stepper-step >
</ nana-stepper >
npm install @nana-tec/ui-components
import " @nana-tec/ui-components/stepper " ;
next() finishes the step it is on and opens the following one. previous()
goes back, and stops at the first. goTo(index) jumps, and returns whether the
rules allowed it.
Steps before current count as finished. completed marks any others, which
matters when a step is finished out of order.
Add linear and a step only opens once the one before it is finished, so a
wizard cannot be skipped through. A finished step can always be reopened.
Without linear, any step can be chosen.
Pick one
Locked until the first is done
Locked too
Show code Copy < nana-stepper linear current = "0" >
< nana-stepper-step label = "Plan" >Pick one</ nana-stepper-step >
< nana-stepper-step label = "Billing" >
Locked until the first is done
</ nana-stepper-step >
< nana-stepper-step label = "Confirm" >Locked too</ nana-stepper-step >
</ nana-stepper >
Show code Copy < nana-stepper orientation = "vertical" current = "1" >
< nana-stepper-step label = "Submitted" ></ nana-stepper-step >
< nana-stepper-step label = "In review" ></ nana-stepper-step >
< nana-stepper-step label = "Decision" ></ nana-stepper-step >
</ nana-stepper >
Key Result ← / → Moves focus along a horizontal trail ↑ / ↓ Moves focus along a vertical trail Home / End Jumps to the first or last step Enter / Space Opens the focused step, if the rules allow
Focus moves freely along the trail; only opening a step is governed by linear.
Properties Property Attribute Type Default Description completedcompletednumber[][]Steps finished out of order, as indices. A step before current counts as done anyway. currentcurrentnumber0Zero-based index of the step being worked on. linearlinearbooleanfalseSteps open only in order. orientationorientationStepperOrientation'horizontal'showProgressshow-progressbooleanfalseDraw the progress line behind the steps.
Events Event Description nana-step-changeAfter the current step moves; detail: { current: number, previous: number }
Slots Slot Description (default)The nana-stepper-step children
CSS parts Part Description ::part(base)The trail container ::part(progress)The progress line behind the steps
CSS custom properties Property Description --nana-stepper-gapSpace between steps --nana-stepper-line-colorColour of the trail line --nana-stepper-line-sizeThickness of the trail line --nana-stepper-step-sizeDiameter of a step marker, which the line is centred on
Properties Property Attribute Type Default Description indexindexnumber0Position in the trail, set by the parent stepper. labellabelstring''The step's name. lastlastbooleanfalseWhether this is the final step, set by the parent. orientationorientationStepperOrientation'horizontal'reachablereachablebooleanfalseWhether the stepper would open this step, set by the parent. statusstatusStepStatus'upcoming'Set by the parent stepper.
Slots Slot Description (default)Description shown under the label
CSS parts Part Description ::part(base)The step container ::part(marker)The numbered or ticked circle ::part(label)The step name ::part(description)The slotted description ::part(connector)The line joining this step to the next
CSS custom properties Property Description --nana-stepper-step-sizeDiameter of the marker --nana-stepper-step-colorMarker colour while upcoming --nana-stepper-step-activeMarker colour while current or complete
Event Type Description nana-step-changeCustomEventThe current step moved; detail carries current and previous.
The trail is a labelled group and each step is a button carrying
aria-current="step" when it is the one being worked on. A step the rules keep
closed reports aria-disabled, and exactly one step stays in the tab order.