Multi-step formPro
One decision at a time with a rolling step count, a progress bar, sliding steps and a submit button whose width follows its label.
oxyn add multi-step-formThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- One decision at a time inside a card — a short setup, a request form an agent hands the user.
- Less chrome than the stepper: a step count and a bar instead of a step list.
When not to use
- A multi-step setup flow: use Stepper Form instead.
- On or off for things that apply right away: use Switch instead.
- A real checkbox with a label and second line, an indeterminate state for Select all, an error, a card row and a check that draws itself: use Checkbox instead.
Installation
Multi-step form is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add multi-step-formUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
First
Step 1 of 4.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Middle
Step 2 with values kept.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Drafts
Save and resume (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
StepperForm
| Prop | Type | Default | Description |
|---|---|---|---|
stepsrequired | Vec<Step> | — | Steps. |
style | String | "stepper" | `stepper` · `minimal` · `vertical`. |
initial_step | usize | Default::default() | First step shown. |
submit_label | String | "Finish" | Last step's button. |
submitting_label | String | "Creating…" | While submitting. |
success_title | String | "Workspace ready" | Success heading. |
latency_ms | u32 | 900 | Simulated submit time (the host's promise). |
fail | bool | Default::default() | The submit fails once (demo of the error next to the button). |
drafts | bool | Default::default() | Oxyn plus: Save draft. |
initial_values | Vec<(String, String)> | Default::default() | Values to start with: `(name, value)`; lists are comma-separated. |
on_step_change | EventHandler<usize> | — | Step changed. |
on_complete | EventHandler<Vec<(String, String)>> | — | Completed: every `(name, value)`. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Enter | Next / submit |
| Tab | Through the step's fields, then Back and Next |
Accessibility
- Each step is a fieldset with a legend; focus moves to the new step's first field.
- A visually hidden polite line announces “Step 2 of 4”.
- The success state is role=status.
From the spec
Each step is a fieldset with a legend; the step count is announced politely ("Step 2 of 4: Team") from a visually hidden status line. Success is role=status.
Motion & interaction
The step number rolls like an odometer; the progress bar eases to the new width; the step slides in the direction of travel; the submit button's width animates to fit its label.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Count roll | 200 ms | ease.out | swap |
| Bar | 360 ms | ease.out | 1 ms |
| Step slide | 260 ms | ease.out | 1 ms |
| Button width / label | ox-snap | spring | instant |
Responsive behaviour
- Below 420 px the header stacks and padding tightens.
Edge cases (spec)
Below 420 px the header stacks and padding tightens. One-step forms show no count. Long labels on the submit button wrap to two lines rather than overflow. Touch: 40 px buttons.
Notes for AI
- Import
StepperFormfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
StepperElinoxyn_gpui. - Props to set first:
steps. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.