ShellUI Logo
ShellUI

Stepper

Multi-step wizard component for guided workflows

The Stepper component guides users through a multi-step process with clear progress indication. It is data-driven — you pass a List<StepItem> with titles, descriptions, and RenderFragment content for each step.

Installation

shellui add stepper

Basic Usage

<Stepper StepItems="@steps" @bind-CurrentStep="currentStep" />

@code {
    private int currentStep = 0;

    private List<StepItem> steps = new()
    {
        new()
        {
            Title = "Account",
            Description = "Create your account",
            Content = @<div class="space-y-4">
                <Input Placeholder="Email" />
                <Input Placeholder="Password" Type="password" />
            </div>
        },
        new()
        {
            Title = "Profile",
            Description = "Set up your profile",
            Content = @<div class="space-y-4">
                <Input Placeholder="Full Name" />
                <Textarea Placeholder="Bio" />
            </div>
        },
        new()
        {
            Title = "Review",
            Description = "Review and submit",
            Content = @<div class="text-sm text-muted-foreground">
                <p>Review your information and click Finish.</p>
            </div>
        }
    };
}

Without Built-in Navigation

Hide the default Previous/Next/Finish buttons and provide your own:

<Stepper StepItems="@steps"
         @bind-CurrentStep="step"
         ShowNavigation="false" />

<div class="mt-4 flex justify-between">
  <Button Variant="ButtonVariant.Outline"
          Disabled="@(step == 0)"
          OnClick="() => step--">
    Back
  </Button>
  @if (step < steps.Count - 1)
  {
    <Button OnClick="() => step++">Continue</Button>
  }
  else
  {
    <Button OnClick="HandleFinish">Submit</Button>
  }
</div>

@code {
    private int step = 0;

    private void HandleFinish() { /* Final submission */ }
}

With Completed Steps

Mark steps as completed to show a checkmark:

<Stepper StepItems="@steps" @bind-CurrentStep="current" />

@code {
    private int current = 2;

    private List<StepItem> steps = new()
    {
        new() { Title = "Details", Description = "Completed", IsCompleted = true },
        new() { Title = "Payment", Description = "Completed", IsCompleted = true },
        new()
        {
            Title = "Confirmation",
            Description = "In progress",
            Content = @<p>Confirm your order.</p>
        }
    };
}

Optional Steps

Mark steps as optional:

<Stepper StepItems="@steps" @bind-CurrentStep="current" />

@code {
    private int current = 0;

    private List<StepItem> steps = new()
    {
        new() { Title = "Required Info", Content = @<p>Fill in required fields.</p> },
        new() { Title = "Additional Info", IsOptional = true, Content = @<p>Optional details.</p> },
        new() { Title = "Finish", Content = @<p>All done!</p> }
    };
}

Preventing Backward Navigation

Disable clicking on previous steps:

<Stepper StepItems="@steps"
         @bind-CurrentStep="current"
         AllowClickToPrevious="false" />

API Reference

Stepper

PropertyTypeDefaultDescription
StepItemsList<StepItem>new()List of step definitions
CurrentStepint0Active step index (0-based)
CurrentStepChangedEventCallback<int>Two-way binding callback
ShowNavigationbooltrueShow built-in Previous/Next/Finish buttons
AllowClickToPreviousbooltrueAllow clicking step indicators to go back
Classstring""Additional CSS classes

StepItem

PropertyTypeDefaultDescription
Titlestring""Step title displayed in the indicator
Descriptionstring?nullOptional description below the title
ContentRenderFragment?nullStep body content (rendered when active)
IsCompletedboolfalseShows a checkmark on the step indicator
IsOptionalboolfalseMarks the step as optional

Accessibility

The Stepper component includes:

  • aria-current="step" on the active step
  • Step numbers announced to screen readers
  • Completed steps shown with checkmark icon
  • Keyboard-navigable step indicators (when AllowClickToPrevious is true)
  • Semantic ordered list structure

On this page