Skip to main content
Neural UIv2.0.0Documentation
View v1 GitHub

Stepper

Guide a multi-step task while keeping content and state in the application.

Category
Navigation
Import
@neural-ui/core/stepper
Selector
neu-stepper
import { NeuStepperComponent } from '@neural-ui/core/stepper';

Usage

steps supplies labels, optional descriptions, completed flags and disabled flags. activeStep is zero-based; accept stepChange to update it. linear prevents skipping ahead more than one step unless the current step is marked completed. next() and prev() propose adjacent steps and respect disabled entries. Render the active content with ordinary Angular control flow inside the component.

Examples

Try the behavior and open Code for the implementation.

Examples

Enter your contact details.

Try and configure

Change the options and try the result. The generated template follows your configuration; Code contains the complete executable source.

Try and configure

Enter your contact details.

Active step: 1

template.html
<neu-stepper
  #wizard
  [steps]="steps()"
  [activeStep]="active()"
  [linear]="true"
  (stepChange)="active.set($event)"
>
  @switch (active()) {
    @case (0) { <p>Contact details</p> }
    @case (1) { <p>Delivery address</p> }
    @case (2) { <p>Review order</p> }
  }
  <button neu-button (neuClick)="wizard.next()">
    Continue
  </button>
</neu-stepper>

Data and content

The application owns activeStep, completion and validation. Calling next() does not mark a step completed or validate a form. Default projection is ordinary content, not a neuStepContent directive.

Accessibility and keyboard

The active button has aria-current="step". Disabled steps cannot be focused. Use Tab to move between enabled buttons and Enter or Space to propose a step. On compact screens labels are available through the accessible name and tooltip.

Key
Action
Tab Move between enabled step buttons.
Enter Propose the focused step; the current step is marked with aria-current.
Space Propose the focused step; the current step is marked with aria-current.

API

Inputs and Outputs match the pinned package. Named types link to their definitions; each supported Template has an executable example.

Inputs

Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.

Name
Type
Default
Template binding
Description
activeStepnumber0[activeStep]Applied zero-based active index.
linearbooleanfalse[linear]Restrict forward skips unless the current step is completed.
stepsNeuStepperStep[][][steps]Ordered step labels, descriptions and completed/disabled states.

Outputs

Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.

Name
Payload
Template binding
Description
stepChangenumber(stepChange)="onStepChange($event)"Proposes the next enabled index; accept it in activeStep.

Templates

ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.

Name
Mechanism
Contract
*

Active step content

View example
Content projection

Use @switch on activeStep to render application-owned content; no neuStepContent directive is needed.

<ng-content />

Context used: โ€”

Each example demonstrates a different template. Switch between Demo and Code to inspect its implementation, imports and state.

Step content

*

Step content

Contact

Your details

This content belongs to the application and follows activeStep.

Public methods

Name
Contract
goTogoTo(i: number): void;
nextnext(): void;
prevprev(): void;

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Use public tokens for spacing, surface, text and focus. Check projected content and controls in both themes and at narrow widths.

Specific tokens

Token
Purpose
State / variant
Default / source
Fallback
--neu-stepper-connector-gap Inherited theme value used by this component Field surface var(--neu-space-2)Root declaration--neu-space-2
--neu-stepper-indicator-radius Corner radius Field surface calc(var(--neu-stepper-indicator-size) / 2)Root declaration--neu-stepper-indicator-size
--neu-stepper-indicator-size Inherited theme value used by this component Field surface 32pxRoot declarationNo token alias

Shared tokens used

Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.

Token
Purpose here
Other impact
Default / fallback
--neu-border Normal control and cell borders Shared by other Core consumers; scope the override. rgba(15, 23, 42, 0.08)
--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff
--neu-primary-dark Dark brand shade; outline and ghost Button text in the light theme Shared by other Core consumers; scope the override. #005fcc
--neu-primary-fg Foreground drawn over the primary background Shared by other Core consumers; scope the override. #ffffff
--neu-primary-solid Solid brand action background Shared by other Core consumers; scope the override. #006ee6
--neu-primary-solid-fg Foreground of solid brand actions Shared by other Core consumers; scope the override. #ffffff
--neu-surface-2 Secondary surfaces and alternating rows Shared by other Core consumers; scope the override. #f1f5f9
--neu-text Main text and inherited icon color Shared by other Core consumers; scope the override. #0f172a