Stepper Layouts
Three layouts render from one component: horizontal (default), vertical, and radial. Toggle the variant to preview each. The markup stays identical across variants; the progress ring and look-ahead text are part of the shared DOM and surface only in radial
Responsive Stepper
A single stepper that morphs between variants as the viewport crosses breakpoints. Suited to flows that span mobile and desktop, where a compact radial on small screens should give way to a full vertical panel on desktop. Resize the window to see the transition
Built-in Features
Activates when .nds-stepper is on the page. Step states, progress display, and control button handlers attach automatically.
Horizontal, vertical, and radial layouts cover wide forms, narrow sidebars, and compact dashboard widgets respectively.
Set data-current and all steps update their completed, current, or upcoming states automatically.
Add data-stepper-control to any button to navigate steps without writing JavaScript.
The nds:stepper:change event fires on every navigation with current step, total, and percentage in the detail.
A single stepper adapts across breakpoints via modifier classes like nds-radial-sm and nds-vertical-lg (same pattern as nds-tableView-sm). One DOM tree renders as horizontal, vertical, or radial depending on viewport.
Add .nds-stepper-next inside any step to show the upcoming step name. Automatically hidden on horizontal and vertical layouts; surfaces only in radial.
Navigate with NDS.Stepper.next(id), NDS.Stepper.previous(id), and NDS.Stepper.goTo(id, step).
Usage Guidelines
Best Practices
- Use steppers for multi-step forms like registration, applications, and onboarding flows where the user completes discrete stages in order
- Use the horizontal layout when you have enough width and want all steps visible at once. This is the default and works best with 3 to 5 steps
- Use the vertical layout when steps need detailed content, action buttons, or the interface is narrow (sidebars, mobile drawers). Add
nds-reverseto flip progress direction from bottom-to-top, useful for timelines or chat-like flows - Use the radial layout for compact spaces like dashboard cards or mobile headers where only the current step needs to be visible
- Use the responsive modifier classes (
nds-{horizontal|vertical|radial}-{sm|md|lg}) when one flow spans multiple breakpoints. Same convention asnds-tableView-sm. The single DOM tree carrying the combined radial + linear markup morphs via JS; no parallel steppers or manual visibility switching needed - Do not use a stepper for indeterminate or percentage-based progress. Use the Progress component instead
- Do not use a stepper for navigation menus or tab-like interfaces. Use Tabs for switching between independent content panels
- Use the dot variant when step labels are not needed and visual progress alone is sufficient, such as onboarding slides or image carousels
- Connecting lines between steps are shown by default on all steps except the last
- Keep step titles short (2 to 4 words). Use the description for additional context
- In radial steppers, add
.nds-stepper-nextinside the step text to preview the upcoming step name. Omit it on the final step - Radial steppers work best with 3 to 6 steps. Fewer than 3 makes the circle progress hard to read; more than 6 makes step titles too compressed
- Always provide a unique
idon the stepper container so control buttons and the JS API can target it
Modifier Classes
| Class | Applies to | Description |
|---|---|---|
nds-vertical | Container | Switches to top-to-bottom layout with vertical connecting lines |
nds-radial | Container | Circular progress indicator showing one step at a time |
nds-dot | Container | Replaces numbered circles with 16px dots (horizontal and vertical) |
nds-sm | Container | Smaller radial circle (48px, radial only) |
nds-lg | Container | Larger circle size (40px linear, 96px radial) |
nds-xl | Container | Extra-large circle size (48px linear, 120px radial) |
nds-center | Container | Centers step content beneath each circle (horizontal only) |
nds-oncolor | Container | Adapts colors for dark or branded backgrounds |
nds-reverse | Container | Reverses vertical stepper direction so progress flows bottom-to-top (vertical only) |
nds-neutral | Container | Neutral gray progress circle color (radial only) |
nds-horizontal-sm / -md / -lg | Container | Forces horizontal layout on mobile / tablet / desktop respectively. Combine with other breakpoint-scoped variants to compose a responsive layout |
nds-vertical-sm / -md / -lg | Container | Forces vertical layout on mobile / tablet / desktop respectively |
nds-radial-sm / -md / -lg | Container | Forces radial layout on mobile / tablet / desktop respectively. Example: nds-radial-sm nds-vertical-lg = radial on mobile, horizontal on tablet, vertical on desktop |
Data Attributes
| Attribute | Description |
|---|---|
data-current | Set on the .nds-stepper container. The active step number (starting from 1). Updating this attribute triggers an automatic UI refresh. |
data-total | Set on the .nds-stepper container. Total number of steps. Updated automatically on init but can be set manually. |
data-step-text | Set on .nds-stepper-circle. Overrides the auto-generated step number with custom text. |
data-stepper-control | Set on any button. Values: next, previous, or goto. Buttons inside a stepper target their parent automatically. |
data-stepper-target | Set on control buttons outside a stepper. The ID of the stepper to control. |
data-stepper-value | Set on goto control buttons. The step number to navigate to. |
data-state="completed" | Set on .nds-stepper-step. Marks the step as completed with a checkmark icon. Managed automatically by JS. |
data-state="current" | Set on .nds-stepper-step. Marks the step as the active step. Managed automatically by JS. |
data-state="upcoming" | Set on .nds-stepper-step. Marks the step as a future step with muted styling. Managed automatically by JS. |
CSS Custom Properties
| Property | Default | Description |
|---|---|---|
--stepper-size | 32px | Circle diameter for linear steppers. Overridden by size classes |
--stepper-gap | token-based | Spacing between steps. Adjusts automatically with size classes |
--progress-size | var(--stepper-size) | Circle diameter for radial steppers. Inherits from --stepper-size, which radial size classes override |
JavaScript API
Steppers auto-initialize on page load. Access instances via NDS.Stepper.get(id) or call convenience methods directly. The nds:stepper:change event fires on every step change.