Set the status of step on a form stepper
const [step, setStep] = useState<number>(-1);
const status: GoabFormStepStatus[] = [
"complete",
"complete",
"incomplete",
"not-started"
];
function setPage(page: number) {
if (page < 1 || page > 4) return;
setStep(page);
}<GoabFormStepper step={step} onChange={(event) => setStep(event.step)}>
<GoabFormStep text="Personal details" status={status[0]} />
<GoabFormStep text="Employment history" status={status[1]} />
<GoabFormStep text="References" status={status[2]} />
<GoabFormStep text="Review" status={status[3]} />
</GoabFormStepper>
<GoabPages current={step} mb="3xl" mt="xl" mr="xl" ml="xl">
<div>
<GoabSkeleton type="article" />
</div>
<div>
<GoabSkeleton type="header" size="2" />
<GoabSkeleton type="text" />
<GoabSkeleton type="header" size="2" />
<GoabSkeleton type="text" />
</div>
<div>
<GoabSkeleton type="text" />
<GoabSpacer vSpacing="m" />
<GoabSkeleton type="text" />
</div>
<div>
<GoabSkeleton type="header" size="2" />
<GoabSkeleton type="text" />
<GoabSpacer vSpacing="m" />
<GoabSkeleton type="text" />
</div>
</GoabPages>
<div style={{ display: "flex", justifyContent: "space-between" }}>
<GoabButton type="secondary" onClick={() => setPage(step - 1)}>
Previous
</GoabButton>
<GoabButton type="primary" onClick={() => setPage(step + 1)}>
Next
</GoabButton>
</div>Set the status of each step on a form stepper to indicate completion progress.
When to use
Use this pattern when:
- Building multi-step forms that need visual progress indication
- Users need to see which steps are complete, incomplete, or not started
- You want to provide clear navigation through a complex form process
- Form completion status needs to be tracked and displayed
Considerations
- The status property accepts “complete”, “incomplete”, or “not-started” values
- Status is controlled by the application based on form completion
- Consider updating step status as users complete each section
- Provide clear Previous/Next navigation to move between steps
- The form stepper can be clicked to navigate directly to completed steps