A stepper shows the steps of a multi-step flow, such as an application form, and which step the user is on. It is a controlled indicator: the app sets activeStep, and each step's progress (completed, current or upcoming) follows from its position. The stepper renders no step panels, no Next or Back buttons and no validation; those stay in the app and its form engine.
✅ Use a stepper when:
- A form is split into a few ordered steps and users benefit from seeing where they are
- A step needs to show that it has an error or a warning, for example after a review page sends the user back
- A long flow needs a step list beside the form (use the vertical orientation)
❌ Don't use a stepper for:
- Navigation between independent sections (use tabs or a side navigation)
- Progress of a single task, such as an upload (use a progress bar)
Wrap the steps in dap-ds-stepper-item elements and set the zero-based activeStep on the stepper. Steps before it are completed and show a check, steps after it are upcoming and show their number.
A step can carry a status of success, warning or error. The status icon replaces the step's number or check, the current step keeps its ring, and a visually hidden word announces the status, so it never relies on color alone.
With clickable="true" every step is a button named "Go to step N: label". Activating a step fires dds-step-click with the step's index; the stepper does not change activeStep itself, so the app decides whether the user may go there. A disabled step stays focusable with aria-disabled="true" and never fires the event.
const stepper = document.querySelector('#clickable-stepper')
stepper.addEventListener('dds-step-click', event => {
stepper.activeStep = event.detail.index
})
When a horizontal stepper's own width is below 36rem (576px at the default font size), it switches to a compact view: the labels and descriptions are hidden visually, the indicators stay on one track, and a "Step N of M: label" line names the current step. The switch is a CSS container query on the stepper, so it follows the space the stepper gets, not the viewport. Every step keeps its accessible name, its status word and, when clickable, its button. The threshold is fixed, because container query conditions cannot read CSS custom properties. A horizontal stepper is a CSS size container (container-type: inline-size), so it takes its width from its parent and not from its content: inside a flex row, give it a width.
Set orientation="vertical" to stack the steps. Each step's label and description sit beside its indicator, and the connectors run down between the indicators. Use it for long flows with more steps than fit on one row, or for a step list in a side column next to the form. A vertical stepper never switches to the compact view, whatever its width, so every label stays visible. Statuses, the current step's ring, disabled steps and clickable steps work as in the horizontal stepper, and the accessibility semantics are the same. The layout uses logical properties, so it mirrors under dir="rtl". An unknown orientation value is treated as horizontal.
Each step exposes the indicator, connector, label, description and button parts, and the colors are custom properties on dap-ds-stepper-item.
dap-ds-stepper-item {
--dds-stepper-item-accent-color: var(--dds-background-positive-base-inverted);
--dds-stepper-item-indicator-size: 40px;
}
dap-ds-stepper-item::part(label) {
text-transform: uppercase;
}
- The stepper is a list named by its
label(default: a localized "Steps"), and each step is a list item. - Only the current step carries
aria-current="step". - Completed steps carry a visually hidden "completed", and a status adds its own word ("success", "warning" or "error").
- Clickable steps are native buttons named "Go to step N: label", followed by the status word; the step's description describes the button.
- Disabled clickable steps stay in the tab order with
aria-disabled="true", so keyboard and screen reader users can still find them and read why they are unavailable. - All default texts exist in English, Hungarian and German.
Import the component by its own subpath. This registers <dap-ds-stepper> (and the
components it renders internally) and lets your bundler include only what you use:
import 'dap-design-system/components/stepper'
Need a reference to the class (e.g. to register it manually or extend it)? The same subpath default-exports it:
import DapDSStepper from 'dap-design-system/components/stepper'
Register the whole library at once — convenient, but pulls every component into your bundle:
import 'dap-design-system'
import { DapDSStepperReact } from 'dap-design-system/react'
| Property | Type | Default | Description |
|---|---|---|---|
activeStep | number | 0 | The zero-based index of the current step. Steps before it are completed, steps after it are upcoming. |
clickable | 'true', 'false' , boolean | false | Whether the steps are buttons that fire dds-step-click. |
label | string, undefined | The accessible name of the step list. Defaults to a localized "Steps". | |
orientation | 'horizontal', 'vertical' | 'horizontal' | The direction of the steps. A vertical stepper puts each label beside its indicator and never switches to the compact view. An unknown value is treated as horizontal. Default is horizontal. |
ariaLabel | string, null | null | Accessible label for the element. Use this to provide a text alternative |
| for elements that don't have visible text content. | |||
ariaExpanded | 'true', 'false' | null | Indicates whether the element is expanded or collapsed. |
ariaControls | string, null | null | Identifies the element that is controlled by this element. |
ariaHasPopup | string, null | null | Indicates the availability and type of interactive popup element. |
ariaDescribedBy | string, null | null | Identifies the element that describes the current element. |
ariaPressed | 'true', 'false' , 'mixed' | null | Indicates the current "pressed" state of toggle buttons. |
ariaHidden | 'true', 'false' | null | Indicates whether the element is hidden from accessibility APIs. |
customStyles | string, undefined | Custom CSS text to be merged with the component's styles. | |
| This CSS will be injected into the shadow DOM and merged with the component's static styles. |
| Name | Description |
|---|---|
(default) | The `dap-ds-stepper-item` elements, in order. |
| Event Name | Description | Type |
|---|---|---|
dds-step-click | Fired when the user activates an enabled step of a clickable stepper. It does not change `activeStep`; the app does. | {index: number } |
| Part Name | Description |
|---|---|
base | The main stepper container. |
list | The list that holds the steps. |
summary | The "Step N of M: label" line shown in the compact view of a horizontal stepper. |
You can style CSS parts using the ::part() pseudo-element selector:
/* Target a specific part */
.my-custom-dap-ds-stepper::part(base) {
/* Your custom styles */
}
/* Target multiple parts */
.my-custom-dap-ds-stepper::part(base),
.my-custom-dap-ds-stepper::part(list) {
/* Shared styles */
}
Example usage:
<dap-ds-stepper class="my-custom-dap-ds-stepper">
Stepper
</dap-ds-stepper>
.my-custom-dap-ds-stepper::part(base) {
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
CSS parts allow you to style internal elements of the component while maintaining encapsulation. Learn more in our styling guide.
| Property Name | Description |
|---|---|
--dds-stepper-summary-color | Color of the compact summary line. (default: var(--dds-text-neutral-strong)) |
--dds-stepper-summary-font-size | Font size of the compact summary line. (default: var(--dds-font-base)) |
CSS custom properties (CSS variables) can be set directly on the component or in your stylesheet:
Method 1: Inline styles (Quick customization)
<dap-ds-stepper
style="--dds-stepper-summary-color: value; --dds-stepper-summary-font-size: value;">
Stepper
</dap-ds-stepper>
Method 2: CSS classes (Reusable styles)
.my-custom-dap-ds-stepper {
--dds-stepper-summary-color: value;
--dds-stepper-summary-font-size: value;
}
<dap-ds-stepper class="my-custom-dap-ds-stepper">
Stepper
</dap-ds-stepper>
Method 3: Global theme customization
/* Apply to all instances */
dap-ds-stepper {
--dds-stepper-summary-color: value;
--dds-stepper-summary-font-size: value;
}
CSS custom properties inherit through the Shadow DOM, making them perfect for theming. Changes apply immediately without rebuilding.
| Property | Type | Default | Description |
|---|---|---|---|
label | string | '' | The label of the step. |
description | string, undefined | Supporting text shown below the label. | |
status | 'success', 'warning' , 'error' | The status of the step, shown with an icon and a visually hidden word. | |
disabled | 'true', 'false' , boolean | false | Whether the step is disabled. A disabled step in a clickable stepper stays |
focusable with aria-disabled and never fires dds-step-click. | |||
ariaLabel | string, null | null | Accessible label for the element. Use this to provide a text alternative |
| for elements that don't have visible text content. | |||
ariaExpanded | 'true', 'false' | null | Indicates whether the element is expanded or collapsed. |
ariaControls | string, null | null | Identifies the element that is controlled by this element. |
ariaHasPopup | string, null | null | Indicates the availability and type of interactive popup element. |
ariaDescribedBy | string, null | null | Identifies the element that describes the current element. |
ariaPressed | 'true', 'false' , 'mixed' | null | Indicates the current "pressed" state of toggle buttons. |
ariaHidden | 'true', 'false' | null | Indicates whether the element is hidden from accessibility APIs. |
customStyles | string, undefined | Custom CSS text to be merged with the component's styles. | |
| This CSS will be injected into the shadow DOM and merged with the component's static styles. |
No slots available.
No custom events available.
| Part Name | Description |
|---|---|
base | The main stepper item container. |
button | The button that wraps the step content when the stepper is clickable. |
indicator | The circle that shows the step number, a check or the status icon. |
connector | The line that connects the indicator to the next step. |
label | The label of the step. |
description | The description of the step. |
| Property Name | Description |
|---|---|
--dds-stepper-item-indicator-size | Size of the indicator circle. (default: var(--dds-spacing-800)) |
--dds-stepper-item-connector-thickness | Thickness of the connector line. (default: var(--dds-border-width-large)) |
--dds-stepper-item-gap | Gap between the indicator and the text: below the indicator row in a horizontal stepper, beside the indicator in a vertical one. (default: var(--dds-spacing-200)) |
--dds-stepper-item-label-color | Color of the label. (default: var(--dds-text-neutral-strong)) |
--dds-stepper-item-description-color | Color of the description. (default: var(--dds-text-neutral-subtle)) |
--dds-stepper-item-accent-color | Color of the current and completed indicators and of the completed connector. (default: var(--dds-background-brand-base-inverted)) |
--dds-stepper-item-track-color | Color of the upcoming indicator border and connector. (default: var(--dds-border-neutral-base)) |