Stepper
Steps of a process with a current and completed state.
On this page
Examples
Interactive
Bind Current to let users click a step.
- Address(completed)Where to ship
- PaymentHow to pay
- ReviewCheck the order
- 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
- Create account(completed)Email and password
- Verify emailCheck your inbox
- 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 |
The steps, as KlyStepperItem . | |
Orientation |
KlyOrientation |
KlyOrientation. |
Direction of the layout: Horizontal or Vertical . Values: Horizontal, Vertical. |
Size |
KlySize |
KlySize. |
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. |