Stepper
Multi-step wizard progress with optional clickable steps.
Import
tsx
import { Stepper, StepperList, StepperItem, StepperIndicator, StepperSeparator, StepperTitle, StepperDescription } from "@cronus-ui/ui";
bash
npx cronus-ui add stepper
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component StepperDefault layout:inline style:stepper {
label "Onboarding"
text "Account"
text "Shipping"
}
page "/audit/stepper/default" type:custom {
use StepperDefault
}
API Reference
Generated from the component's exported types.
StepperLabels
| Prop | Type | Default | Description |
|---|---|---|---|
completed* | string | — | Announced after a completed step. |
current* | string | — | Announced after the active step. |
upcoming* | string | — | Announced after a step that has not started yet. |
StepperProps
Extends Omit<HTMLAttributes<HTMLDivElement>, "onChange">
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Controlled active step index. When provided the stepper is fully controlled. |
defaultValue | number | 0 | Initial active step index for the uncontrolled case. Defaults to `0`. |
onValueChange | (value: number) => void | — | Called whenever a step should become active (controlled or not). |
orientation | StepperOrientation | "horizontal" | Layout axis. Defaults to `"horizontal"`. |
labels | Partial<StepperLabels> | — | Localize the sr-only step-state announcements. See . |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
StepperItemProps
Extends HTMLAttributes<HTMLLIElement>
| Prop | Type | Default | Description |
|---|---|---|---|
step* | number | — | This step's zero-based index. Required so the item can derive its state (completed / active / upcoming) from the stepper's active value. |
completed | boolean | — | Mark the step done explicitly. Overrides the index-derived "completed". |
disabled | boolean | false | Disable interaction + dim the step. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
StepperIndicatorProps
Extends HTMLAttributes<HTMLSpanElement>, Omit<VariantProps<typeof stepperIndicatorVariants>, "state">
| Prop | Type | Default | Description |
|---|---|---|---|
children | HTMLAttributes<HTMLSpanElement>["children"] | — | Override the auto-rendered content (step number / check). |
asChild | boolean | — | Render as the child element via Slot. |
className | string | — | Additional class names merged onto the root. |
id | string | — | DOM id of the root element. |
StepperTriggerProps
Extends ButtonHTMLAttributes<HTMLButtonElement>
| Prop | Type | Default | Description |
|---|---|---|---|
type | string | — | Native type of the underlying element. |
disabled | boolean | — | Disables pointer and keyboard interaction. |
onClick | (event: MouseEvent) => void | — | Click handler. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
StepperListProps
Extends OlHTMLAttributes<HTMLOListElement>
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
start | number | — | — |
StepperSeparatorProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
StepperTitleProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
StepperDescriptionProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |