Skip to content

CdsSteps

The stepper walks the user through a multi-step process: it shows which steps are done, which one is active and how many are left. It can switch the content of the steps and renders the "Back" / "Next" buttons out of the box, while a header without content works as a status tracker.

Storybook GitLab Figma
Test coverage: no tests

This component has no automated tests yet: its behavior is verified manually only.

API in specs
0 / 75 props, events, slots and exposed members with a test
Test cases
0 unit · 0 browser
Code coverage
13.1% lines · 0% branches measured in v4.0.0-alpha.13
A11y (axe)
5 recommendations in 11 stories measured in v4.0.0-alpha.11

The stepper shows the progress of a business process without step navigation on its own: without the interactive prop the steps are not clickable, and the header without items works as a status tracker — see the "Request status" scenario. The CdsStages component, which used to solve the same task, is deprecated. For sections of equal weight that are switched in any order, use CdsTabs.

Anatomy ​

The stepper consists of a header with the steps, a content area and the navigation buttons — the last two appear when the steps are set through items. Every step is a state indicator with a progress line up to the next step, a title and a description.

Variations ​

Steps from an array ​

Pass an array of objects into items — the title, the description and the value of a step are read by the item-title, item-text and item-value keys (by default title, text, and the value is the ordinal number of the step starting from one). The content of a step comes from the item.{value} slots or from the shared item slot, and the "Back" / "Next" buttons are rendered automatically: their texts are changed by the prev-text / next-text props, and hide-actions hides the buttons.

States ​

Steps can also be declared by hand — with CdsStepsItem components in the default slot: only the header is rendered, the content and the navigation stay up to you. A step has three states: error — finished with an error, warning — needs attention, disabled — unavailable.

Interactive steps ​

The interactive prop allows jumping to any step by click or from the keyboard — the progress animates in a cascade and disabled steps are skipped. The readonly prop turns the transitions off while keeping the appearance.

Vertical layout ​

The vertical prop turns the header into a column — a good fit for status trackers and narrow panels.

Slots ​

Slots give control over every area of the stepper:

SlotDescription
defaultYour own CdsStepsItem when items is not set
title, textTitle and description of every step
header-item, header-item.{value}Full replacement of the step content in the header
item, item.{value}Step content in the content area
actionsYour own navigation buttons (receives the prev / next methods)
prev, nextReplacement of a single button inside the default navigation block

The title and text slots receive the state of the step (selected, complete, error, first, last…) — handy for adding tags and hints.

Model ​

The active step is controlled through v-model. For steps from items the default value is the ordinal number starting from one; for steps declared by hand it is the index starting from zero. Your own value is set by the item-value key or by the value prop of CdsStepsItem. The prev / next methods are available through the component ref.

Guidelines ​

Scenarios ​

Checkout wizard ​

A classic wizard: every step gets its own item.{value} slot with a form. The built-in buttons page through the steps, and the fields are bound to shared state through v-model, so the data survives the transitions.

Confirmation before moving on ​

The actions slot replaces the built-in buttons and receives the prev and next methods — you define the conditions of the transition yourself. Here the "Next" button stays disabled until the user accepts the terms of service.

Request status ​

A header without items works as a process tracker: only the steps, no content and no buttons. The completed stages are marked with indicators, and the descriptions carry the dates and the deadlines. The vertical prop lays the history out in a column.

API ​

CdsSteps ​

Props

NameTypeDefaultDescription
disabledboolean | null | undefinednullDisabled state
hideActionsboolean | undefined—Hides the step navigation buttons
interactiveboolean | undefined—Allows jumping to a step by click
itemPropsSelectItemKey'props'Object field that holds the props of the item, or a function that returns them
itemsany[] | undefined[]Array of items to display
itemTextSelectItemKey'text'Key of the step description in an items element object
itemTitleSelectItemKey'title'Object field used as the item title, or a function that returns it
itemValueSelectItemKey'value'Object field used as the item value, or a function that returns it
mandatoryboolean | "force" | undefined'force'Requires at least one item to stay selected
maxnumber | undefined—Maximum number of items that can be selected
modelValueany—Value of the selected items of the group
multipleboolean | undefined—Allows selecting several items at once
nextTextstring | undefined'$cds.steps.next'Text of the next step button
prevTextstring | undefined'$cds.steps.prev'Text of the previous step button
readonlyboolean | null | undefinednullRead-only state
requiredboolean | "force" | undefined'force'Requires at least one item to stay selected
selectedClassstring | undefined'cds-steps-item--current'CSS class applied in the selected state
tagstring | JSXComponent<any> | undefined'div'Custom HTML tag or component to render
themestring | undefined—Component theme
verticalboolean | undefined—Vertical layout

Events

NameTypeDescription
update:modelValue[value: unknown]Fired when the v-model value changes

Slots

NameTypeDescription
actionsCdsStepsSlotCustom navigation buttons
defaultCdsStepsSlotHeader content: custom CdsStepsItem (used when items is not set)
header-itemCdsStepsItemSlotCustom rendering of every step content in the header
itemCdsStepsInternalItemStep content in the content area
nextCdsStepsActionsSlotCustom next step button
prevCdsStepsActionsSlotCustom previous step button
textCdsStepsItemSlotCustom description of every step
titleCdsStepsItemSlotCustom title of every step

Exposed

NameTypeDescription
next() => voidMoves to the next step.
prev() => voidMoves to the previous step.

CdsStepsActions ​

Props

NameTypeDefaultDescription
disabledboolean | "next" | "prev" | undefinedfalseDisables the navigation buttons: both or a specific one
nextTextstring | undefined'$cds.steps.next'Text of the next step button
prevTextstring | undefined'$cds.steps.prev'Text of the previous step button

Events

NameTypeDescription
click:next[]Click on the next step button
click:prev[]Click on the previous step button

Slots

NameTypeDescription
nextCdsStepsActionsSlotCustom next step button
prevCdsStepsActionsSlotCustom previous step button

CdsStepsItem ​

Props

NameTypeDefaultDescription
disabledboolean | null | undefinednullDisabled state
errorboolean | undefined—The step finished with an error
interactiveboolean | undefined—Allows jumping to a step by click
readonlyboolean | null | undefinednullRead-only state
selectedClassstring | undefined—CSS class applied in the selected state
textstring | undefined—Step description
titlestring | undefined—Step title
valueany—Value of the component within the group
warningboolean | undefined—The step needs attention

Events

NameTypeDescription
group:selected[value: { value: boolean; }]Fired when the selected state of the step inside the group changes

Slots

NameTypeDescription
defaultCdsStepsItemSlotExtra step content after the title and the description
textCdsStepsItemSlotCustom step description
titleCdsStepsItemSlotCustom step title

CdsStepsView ​

Props

NameTypeDefaultDescription
crossfadeboolean | undefined—Slides change with a smooth crossfade instead of a shift
direction"horizontal" | "vertical" | undefined'horizontal'Switches the component between horizontal and vertical layout.
disabledboolean | null | undefinednullDisabled state
maxnumber | undefined—Maximum number of items that can be selected
modelValueany—Value of the selected items of the group
multipleboolean | undefined—Allows selecting several items at once
reverseboolean | undefined—Inverts the direction of the transition animation between slides
selectedClassstring | undefined—CSS class applied in the selected state
tagstring | JSXComponent<any> | undefined'div'Custom HTML tag or component to render
themestring | undefined—Component theme
transitionDurationnumber | undefined—Duration of the transition animation between slides, in milliseconds
verticalArrowsboolean | "left" | "right" | undefined—Places the navigation arrows vertically: 'left' or 'right' — the side, true — the default side

Events

NameTypeDescription
update:modelValue[value: any]Fired when the v-model value changes

Slots

NameTypeDescription
additional{ group: GroupProvide; }Extra content above the slides — indicator dots or your own navigation, for example
default{ group: GroupProvide; }Slides. The slot props carry the group state for controlling the active slide
next{ props: ControlProps; }Button that moves to the next slide. The slot props are ready to bind to your own button
prev{ props: ControlProps; }Button that moves to the previous slide. The slot props are ready to bind to your own button

CdsStepsViewItem ​

Props

NameTypeDefaultDescription
disabledboolean | null | undefinednullDisabled state
eagerboolean | undefined—Renders the content of the component right away. Useful when you have content that is not in the DOM but has to be indexed for SEO.
reverseTransitionstring | boolean | undefined—Transition used when the slide appears in the reverse direction. A transition component name, or false to turn the animation off
selectedClassstring | undefined—CSS class applied in the selected state
transitionstring | boolean | undefined—Transition used when the slide appears in the forward direction. A transition component name, or false to turn the animation off
valueany—Value of the component within the group

Slots

NameTypeDescription
defaultanyContent of the slide