Skip to main content
The Stepper component guides users through a multi-step process, showing progress and allowing navigation between steps.

Basic usage

<flx-stepper [(activeStep)]="currentStep">
  <flx-step label="Account" icon="user">
    <h3>Create your account</h3>
    <!-- Account form content -->
  </flx-step>
  
  <flx-step label="Profile" icon="id-card">
    <h3>Complete your profile</h3>
    <!-- Profile form content -->
  </flx-step>
  
  <flx-step label="Preferences" icon="settings">
    <h3>Set preferences</h3>
    <!-- Preferences content -->
  </flx-step>
</flx-stepper>

Stepper properties

activeStep
number
default:"0"
Index of the currently active step
orientation
'horizontal' | 'vertical'
default:"horizontal"
Layout direction of the stepper
linear
boolean
default:"false"
When true, users must complete steps in order
editable
boolean
default:"true"
Allows navigation to completed steps

Step properties

label
string
required
Label displayed for the step
icon
string
Icon to display in the step indicator
state
'incomplete' | 'active' | 'complete' | 'error'
Current state of the step
optional
boolean
default:"false"
Marks the step as optional
disabled
boolean
default:"false"
Disables navigation to this step
completed
boolean
default:"false"
Marks the step as completed

Events

activeStepChange
EventEmitter<number>
Emitted when the active step changes
stepClick
EventEmitter<number>
Emitted when a step is clicked

Examples

<flx-stepper [(activeStep)]="currentStep">
  <flx-step label="Personal Info">
    <form>
      <flx-input label="Name" [(ngModel)]="data.name"></flx-input>
      <flx-input label="Email" [(ngModel)]="data.email"></flx-input>
      <button (click)="nextStep()">Next</button>
    </form>
  </flx-step>

  <flx-step label="Address">
    <form>
      <flx-input label="Street" [(ngModel)]="data.street"></flx-input>
      <flx-input label="City" [(ngModel)]="data.city"></flx-input>
      <button (click)="previousStep()">Back</button>
      <button (click)="nextStep()">Next</button>
    </form>
  </flx-step>

  <flx-step label="Review">
    <div class="review">
      <h4>Review your information</h4>
      <p>Name: {{ data.name }}</p>
      <p>Email: {{ data.email }}</p>
      <p>Address: {{ data.street }}, {{ data.city }}</p>
      <button (click)="previousStep()">Back</button>
      <button (click)="submit()">Submit</button>
    </div>
  </flx-step>
</flx-stepper>
export class MultiStepForm {
  currentStep = 0;
  data = {
    name: '',
    email: '',
    street: '',
    city: ''
  };

  nextStep() {
    this.currentStep++;
  }

  previousStep() {
    this.currentStep--;
  }

  submit() {
    console.log('Form submitted:', this.data);
  }
}

Styling

flx-stepper {
  --flx-stepper-indicator-size: 32px;
  --flx-stepper-indicator-border: 2px;
  --flx-stepper-line-thickness: 2px;
  --flx-stepper-incomplete-color: #d1d5db;
  --flx-stepper-active-color: #3b82f6;
  --flx-stepper-complete-color: #10b981;
  --flx-stepper-error-color: #ef4444;
  --flx-stepper-label-color: #6b7280;
  --flx-stepper-active-label-color: #111827;
}

Accessibility

The Stepper component ensures accessibility:
  • role="tablist" for step headers
  • role="tab" for individual steps
  • aria-current="step" for active step
  • aria-disabled for disabled steps
  • Keyboard navigation (Arrow keys, Home, End)
  • Screen reader announcements

Best practices

  • Use 3-5 steps for optimal user experience
  • Provide clear, concise step labels
  • Show progress visually with completion indicators
  • Enable back navigation unless data loss is a concern
  • Use linear mode for processes that must be completed in order
  • Mark optional steps clearly
  • Validate each step before allowing progression
  • Provide clear error states for invalid steps
  • Save progress automatically or provide save options
For long forms, use the stepper to break content into manageable sections. Each step should take about 30-60 seconds to complete.
When using linear mode, ensure each step has clear validation and error messaging so users understand why they can’t proceed.

Build docs developers (and LLMs) love