Expand description
Stepper — a modern, embeddable step-flow widget (Material/Ant/Flutter
“stepper”), and Wizard, a thin modal launcher built on it.
A stepper shows a visible step-indicator strip above (or beside) a
content area driven by a Switcher, with a
footer of Back / Skip / Help / Next / Finish controls. It supports linear
and non-linear (clickable) navigation, optional + skippable steps, per
step validation gating, a generic chrome slot, and a
StepperController handle for programmatic reset / jump / introspection.
§Data flow
The application owns its form state as Signals. A step’s content factory
captures clones of those signals (write side); Step::complete_when
derives the Next gate from the same signals; and
Stepper::on_finish reads them back — plus the StepperController for
per-step introspection (visited / skipped) — to branch on the choices
made. There is no QVariant field registry: plain shared signals are the
cross-step channel.
#[derive(Clone)]
struct Form { name: Signal<String>, plan: Signal<Plan> }
let form = Form { name: Signal::new(String::new()), plan: Signal::new(Plan::Free) };
Stepper::new()
.step(Step::new(lit!("Account"))
.content({ let f = form.clone(); move || TextInput::new().text(f.name.clone()) })
.complete_when(form.name.map(|n| !n.is_empty())))
.step(Step::new(lit!("Plan"))
.content({ let f = form.clone(); move || plan_picker(f.plan.clone()) }))
.on_finish({ let f = form.clone(); move |_ctx, ctrl| {
match f.plan.get() { Plan::Free => {/* … */} Plan::Pro => {/* … */} }
let _ = ctrl.skipped(1);
}});Structs§
- Step
- One page in a
Stepper. - Stepper
- An embeddable multi-step flow widget. See the module docs for the data-flow pattern and a usage example.
- Stepper
Controller - Shared handle controlling a
Stepper. - Wizard
- A button (or custom trigger) that opens a modal
Stepper.
Enums§
- Chrome
Position - Where the optional chrome slot (banner / sidebar) sits relative to the stepper body.
- Finish
Outcome - What an
on_finishcallback decided. - Step
Status - Lifecycle state of a single step, surfaced in the indicator strip and
(for the active step) as
aria-current="step". - Stepper
Orientation - Indicator-strip orientation for a
Stepper.
Traits§
- Into
Finish Outcome - Return-type bridge for
Stepper::on_finish/Wizard::on_finishcallbacks, so the same setter accepts a callback that cannot fail and one that can.