Skip to content
Navigation Stepper

Stepper

Steps of a process with a current and completed state.

On this page

Examples

Interactive

Bind Current to let users click a step.

  1. Address(completed)Where to ship
  2. PaymentHow to pay
  3. ReviewCheck the order
  4. Done

Choose a payment method.

Step: 2 of 4

Razor
<div class="w-full max-w-2xl">
    <KlyStepper Items="Items" @bind-Current="_step" AriaLabel="Checkout" />
    <p class="mt-4 text-sm text-(--klyroo-text-muted)" data-testid="step-state">Step: @(_step + 1) of @Items.Length</p>
</div>

@code {
    private int _step = 1;

    private static readonly KlyStepperItem[] Items =
    [
        new("Address") { Description = "Where to ship", Content = @<p class="text-sm">Enter your shipping address.</p> },
        new("Payment") { Description = "How to pay", Content = @<p class="text-sm">Choose a payment method.</p> },
        new("Review") { Description = "Check the order", Content = @<p class="text-sm">Review your order.</p> },
        new("Done") { Disabled = true },
    ];
}

Vertical

  1. Create account(completed)Email and password
  2. Verify emailCheck your inbox
  3. Set up profileName and avatar
Razor
<div class="w-full max-w-xs">
    <KlyStepper Items="Items" Current="1" Orientation="KlyOrientation.Vertical" Color="KlyColor.Success" AriaLabel="Onboarding" />
</div>

@code {
    private static readonly KlyStepperItem[] Items =
    [
        new("Create account") { Description = "Email and password" },
        new("Verify email") { Description = "Check your inbox" },
        new("Set up profile") { Description = "Name and avatar" },
    ];
}

API

KlyStepper

Sequence of steps with the current one marked, which can be static or interactive.

Parameters

Name Type Default Description
AriaLabel string Accessible name of the list of steps.
Class string Classes added to the root element, merged last so they win over the theme.
Color KlyColor "primary" Semantic color of the stepper: a built-in KlyColor or the name of a color you defined. When not set, Color applies, else the default of the component. Values: primary, secondary, success, info, warning, error, neutral.
Current (@bind-Current) int 0 Index of the current step, starting at 0. Earlier steps are completed.
Items (required) IReadOnlyList<KlyStepperItem> The steps, as KlyStepperItem .
Orientation KlyOrientation KlyOrientation.Horizontal Direction of the layout: Horizontal or Vertical . Values: Horizontal, Vertical.
Size KlySize KlySize.Md Size of the stepper, from Xs to Xl . When not set, Size applies, else the default of the component. Values: Xs, Sm, Md, Lg, Xl.
Ui StepperUi Per-instance class overrides of the slots of the stepper, see StepperUi . They are merged after the theme and the Class parameter wins on the root slot.

Ui slots

Ui takes a StepperUi with one class string per slot, merged after the theme.

Slot Styles
Root Classes merged into the root slot of KlyStepper , after the theme and the app configuration.
List Classes merged into the list slot of KlyStepper , after the theme and the app configuration.
Item Classes merged into the item slot of KlyStepper , after the theme and the app configuration.
Track Classes merged into the track slot of KlyStepper , after the theme and the app configuration.
Indicator Classes merged into the indicator slot of KlyStepper , after the theme and the app configuration.
Separator Classes merged into the separator slot of KlyStepper , after the theme and the app configuration.
Icon Classes merged into the icon slot of KlyStepper , after the theme and the app configuration.
Text Classes merged into the text slot of KlyStepper , after the theme and the app configuration.
Title Classes merged into the title slot of KlyStepper , after the theme and the app configuration.
Description Classes merged into the description slot of KlyStepper , after the theme and the app configuration.
Status Classes merged into the status slot of KlyStepper , after the theme and the app configuration.
Content Classes merged into the content slot of KlyStepper , after the theme and the app configuration.