Skip to content

Component proposal: Stepper #45

Description

@dexterhere

Component proposal: Stepper

I would like to contribute a new Stepper component to Rust/UI.

Motivation

Rust/UI currently provides components such as Progress, Tabs, Forms and Status indicators, but it does not have a dedicated Stepper for multi-step workflows.

A Stepper would be useful for:

  • Account onboarding
  • Checkout processes
  • Multi-step forms
  • Installation flows
  • Verification processes
  • Project setup wizards

Proposed initial scope

The first version would support:

  • Horizontal orientation
  • Vertical orientation
  • Controlled current-step state
  • Completed, active and pending step states
  • Optional clickable step triggers
  • Disabled steps
  • Custom labels and descriptions
  • Custom indicator content
  • Keyboard-accessible native buttons
  • aria-current="step" for the active step
  • Tailwind CSS styling
  • Pure Rust and Leptos implementation without JavaScript

Proposed component anatomy

<Stepper value=current_step>
    <StepperItem step=0>
        <StepperTrigger>
            <StepperIndicator />
            <StepperTitle>"Account"</StepperTitle>
            <StepperDescription>
                "Create your account"
            </StepperDescription>
        </StepperTrigger>
        <StepperSeparator />
    </StepperItem>

    <StepperItem step=1>
        <StepperTrigger>
            <StepperIndicator />
            <StepperTitle>"Profile"</StepperTitle>
            <StepperDescription>
                "Complete your profile"
            </StepperDescription>
        </StepperTrigger>
    </StepperItem>
</Stepper>

The internal step state would be calculated as:

  • step < current_step → completed
  • step == current_step → active
  • step > current_step → pending

Possible files

app_crates/registry/src/ui/stepper.rs
app_crates/registry/src/demos/demo_stepper.rs
app_crates/registry/src/demos/demo_stepper_controlled.rs
app_crates/registry/src/demos/demo_stepper_vertical.rs
public/docs/components/stepper.md

I would first implement the basic controlled component and orientations. Advanced features such as validation states, optional steps, error states and step content panels could be added separately.

Would this component and scope be suitable for Rust/UI? I would also appreciate guidance on the preferred controlled-state API.

Note: The contribution guide recommends discussing new component ideas through GitHub Discussions. However, the Discussions link currently returns a 404 error. I am submitting this proposal here instead so the component scope and API can be reviewed before I begin the full implementation.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions