Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Context Menu
  • Drawer
  • Footer
  • Menu
  • Navbar
  • On This Page
  • Separator
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Container
  • Flex
  • Grid
  • Text
  • Link
  • Button
  • Form
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • Input GroupNew
    • NumericNew
    • Masked InputNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Tag InputNew
    • Text EditorNew
    • Textfield
    • Time Picker
    • Time Range Picker
  • Toggle
  • Toggle Group
  • Alert
  • Avatar
  • Badge
  • Chip
  • Empty
  • Icon
  • Popover
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • SpreadsheetNew
  • Column Filter Editor
  • Pagination
  • Pick List
  • Barcode
  • QR Code
  • Calendar
  • Table
  • Attachment
  • Overview
    • Bar
    • Bullet
    • Column
    • Dot Plot
    • Dumbbell
    • Icon
    • Lollipop
    • Radial Bar
    • Range
    • Word Cloud
    • Area
    • Bump
    • Bump Area
    • Candlestick
    • Gantt
    • Horizon
    • Line
    • Slope
    • Small Multiples
    • Stream Graph
    • Funnel
    • Gauge
    • Marimekko
    • Nightingale
    • Pie
    • Treemap
    • Waffle
    • Waterfall
    • Circular Treemap
    • Convex Treemap
    • Dendrogram
    • Sunburst
    • Barcode
    • Beeswarm
    • Box Plot
    • Density Plot
    • Histogram
    • Radial Histogram
    • Ridgeline
    • Strip Plot
    • Violin Plot
    • Categorical Scatter
    • Contour
    • Hexagonal Binning
    • Quadrant
    • Scatter
    • Heatmap
    • Matrix
    • Parallel Coordinates
    • Radar
    • Arc Diagram
    • Chord Diagram
    • Flowchart
    • Network Diagram
    • Sankey
    • Euler Diagram
    • Venn Diagram
  • Bubble
  • Marker
  • Message
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Layout

TwStepper

TwStepper is a Blazor stepper for multi-step flows. Bind ActiveStepIndex, set Orientation, Linear and Color, and give each step a Label and Description.

Last updated 6 October 2026

Basic stepper

Add TwStep children to a TwStepper to declare each step, and bind ActiveStepIndex to control which one is active. Wire your own "Back"/"Next" buttons to a component reference's PreviousStep() and NextStep() methods, as shown below. Below the "sm" breakpoint the step row automatically collapses into a compact progress bar with a "Step X of N" label, so try resizing your browser to see it adapt.
  1. AccountCreate your login
  2. AddressWhere to ship
  3. ReviewConfirm and pay
33%

Step 1 of 3: Account

Enter your email address and choose a password.

RAZOR
<TwStepper @ref="basicStepper" @bind-ActiveStepIndex="basicActiveStep" AriaLabel="Checkout progress">
    <TwStep Label="Account" Description="Create your login">
        <p>Enter your email address and choose a password.</p>
    </TwStep>
    <TwStep Label="Address" Description="Where to ship">
        <p>Enter the shipping address for your order.</p>
    </TwStep>
    <TwStep Label="Review" Description="Confirm and pay">
        <p>Review your order details before confirming payment.</p>
    </TwStep>
</TwStepper>

<div class="flex gap-2 mt-4">
    <TwButton Label="Back" Variant="ButtonVariant.Outlined" Color="Color.Primary" Disabled="@(basicActiveStep <= 0)" OnClick="@(() => basicStepper.PreviousStep())" />
    <TwButton Label="Next" Disabled="@(basicActiveStep >= 2)" Color="Color.Primary" OnClick="@(() => basicStepper.NextStep())" Variant="ButtonVariant.Filled" />
</div>
CSHARP
@code {
    private TwStepper basicStepper = null!;
    private int basicActiveStep;
}

Validating a step

Pass your own validation Task to a "Next" button's click handler and only call NextStep when it passes - the stepper doesn't need to know anything about your validation logic.
  1. Email
  2. Done
50%

Step 1 of 2: Email

RAZOR
<TwStepper @ref="validatedStepper" @bind-ActiveStepIndex="validatedActiveStep" Linear AriaLabel="Signup progress">
    <TwStep Label="Email">
        <TwTextfield Label="Email address" @bind-Value="signupEmail" Placeholder="Enter your email address" AriaLabel="Email address" Invalid="@emailInvalid" ErrorMessage="Please enter a valid email address." />
    </TwStep>
    <TwStep Label="Done">
        <p>Thanks, @signupEmail is confirmed!</p>
    </TwStep>
</TwStepper>

<div class="flex gap-2 mt-4">
    <TwButton Label="Back" Variant="ButtonVariant.Outlined" Color="Color.Primary" Disabled="@(validatedActiveStep <= 0)" OnClick="@(() => validatedStepper.PreviousStep())" />
    <TwButton Label="Next" Disabled="@(validatedActiveStep >= 1)" Color="Color.Primary" OnClick="ValidateAndContinue" Variant="ButtonVariant.Filled" />
</div>
CSHARP
@code {
    private TwStepper validatedStepper = null!;
    private int validatedActiveStep;
    private string signupEmail = string.Empty;
    private bool emailInvalid;
    
    private Task ValidateAndContinue()
    {
        emailInvalid = string.IsNullOrWhiteSpace(signupEmail) || !signupEmail.Contains('@');
        return emailInvalid ? Task.CompletedTask : validatedStepper.NextStep();
    }
}

Non-linear stepper

Set Linear="false" to let users jump straight to any non-disabled step by clicking it, instead of only being able to reach steps they've already visited.
  1. Step 1
  2. Step 2
  3. Step 3
  4. Step 4
25%

Step 1 of 4: Step 1

RAZOR
<TwStepper @bind-ActiveStepIndex="nonLinearActiveStep" Linear="false" AriaLabel="Non-linear progress">
    <TwStep Label="Step 1" />
    <TwStep Label="Step 2" />
    <TwStep Label="Step 3" />
    <TwStep Label="Step 4" />
</TwStepper>

Disabled step

Set Disabled on a TwStep to prevent it from being navigated to, whether by clicking or via NextStep/PreviousStep (which both skip over it).
  1. Details
  2. Shipping
  3. Payment
33%

Step 1 of 3: Details

RAZOR
<TwStepper @bind-ActiveStepIndex="disabledActiveStep" Linear="false" AriaLabel="Progress with a disabled step">
    <TwStep Label="Details" />
    <TwStep Label="Shipping" Disabled />
    <TwStep Label="Payment" />
</TwStepper>

Vertical stepper

Set Orientation="StepperOrientation.Vertical" to stack steps top-to-bottom, with each step's content shown inline beneath its label while it's active.
  1. Create accountA few basic details

    Choose a username and password to get started.

  2. Verify emailOptional
  3. Done
RAZOR
<TwStepper @ref="verticalStepper" @bind-ActiveStepIndex="verticalActiveStep" Orientation="StepperOrientation.Vertical" AriaLabel="Onboarding progress">
    <TwStep Label="Create account" Description="A few basic details">
        <p class="mb-3">Choose a username and password to get started.</p>
        <TwButton Label="Continue" OnClick="@(() => verticalStepper.NextStep())" Dense />
    </TwStep>
    <TwStep Label="Verify email" Description="Optional">
        <p class="mb-3">We've sent a confirmation link to your inbox.</p>
        <div class="flex gap-2">
            <TwButton Label="Back" Variant="ButtonVariant.Outlined" Color="Color.Primary" OnClick="@(() => verticalStepper.PreviousStep())" Dense />
            <TwButton Label="Continue" OnClick="@(() => verticalStepper.NextStep())" Color="Color.Primary" Dense Variant="ButtonVariant.Filled" />
        </div>
    </TwStep>
    <TwStep Label="Done">
        <p>You're all set!</p>
    </TwStep>
</TwStepper>
CSHARP
@code {
    private TwStepper verticalStepper = null!;
    private int verticalActiveStep;
}

Colored stepper

Set Color to change the accent used for the active and completed step indicators and connectors.
  1. Step 1
  2. Step 2
  3. Step 3
33%

Step 1 of 3: Step 1

RAZOR
<TwStepper @bind-ActiveStepIndex="coloredActiveStep" Linear="false" Color="Color.Success" AriaLabel="Success-colored progress">
    <TwStep Label="Step 1" />
    <TwStep Label="Step 2" />
    <TwStep Label="Step 3" />
</TwStepper>

Keyboard navigation

The steps are a navigation landmark. Each step you can go to is a button, and the step you land on is announced.
Key What it does
Tab or Shift+ plus Tab Moves between the steps you can go to. In a linear stepper those are the current step and the ones before it.
Enter or Space Goes to the focused step.

Theme configuration

Styling is controlled by TwBlazorTheme.Components (a TwStepperTheme), configured via the AddTwBlazor() options callback described on the Get Started page. Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
Property Type Controls
HorizontalList string
VerticalList string
Step string
VerticalStep string
VerticalIndicatorColumn string
VerticalContentColumn string
Connector string
VerticalConnector string
ConnectorNeutral string
Circle string
CircleUpcoming string
CircleDisabled string
CircleClickable string
CircleIcon string
Label string
LabelUpcoming string
Description string
Content string
VerticalContent string
MobileContainer string
MobileLabel string
MobileProgressLabel string
CircleFrame string
CircleFrameInactive string
CircleUpcomingClickable string
LabelActive string

Full reference: TwStepperTheme on the API docs.

On this page

  • Basic stepper
  • Validating a step
  • Non-linear stepper
  • Disabled step
  • Vertical stepper
  • Colored stepper
  • Keyboard navigation
  • Theme configuration
twblazor

The Tailwind CSS component library for Blazor. Accessible, themeable and MIT licensed.

Discord (opens in a new tab) GitHub(opens in a new tab)

Get started

  • Install guide
  • Theming
  • Class merging
  • Localization

Guides

  • Tailwind CSS with Blazor
  • Why twblazor?
  • Right to left
  • AI agents and skills

Resources

  • API documentation (opens in a new tab)
  • llms.txt (opens in a new tab)
  • MIT License (opens in a new tab)

Community

  • Contributing (opens in a new tab)
  • Code of conduct (opens in a new tab)
  • Report an issue (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload