{/* Step indicators */}
{STEPS.map(({ label }, i) => (
{i < step ? "✓ " : ""}
{label}
))}
{submitted &&
{JSON.stringify(submitted, null, 2)}}
);
}
export default EgWizardForm;
```
## How it works
**Step state lives outside the form.** `step` is plain `useState`. The form has no concept of steps; it only sees three `section` fields whose `visible` function reads `step`:
```ts
account: {
type: "section",
visible: () => step === 0,
props: { nested: true, component: AccountStep },
},
```
A `visible` function that reads React state re-runs whenever the parent re-renders, so `setStep` is all the navigation needs.
**"Next" validates only the current step.** The `children` render prop exposes `trigger`. Pass the paths of the current step, and move on only when they are valid:
```tsx
{({ trigger }) => (