Sub topic 2
Splitting input into steps
This chapter covers how to decide what goes on each screen of a guided flow. It assumes you can build a basic form, know what a field and a validation rule are, and have a rough idea of application state. The later chapters build the state model and navigation. Here the focus is the design decision that comes first: where the step boundaries go.
Why step boundaries matter
A step is a group of inputs the user answers together before moving on. Step boundaries shape everything that follows. They decide where validation runs, what Back returns to, what the progress indicator counts, and where a draft can be saved.
Poor boundaries cause problems that are hard to fix later with code. A step that mixes unrelated questions produces vague error messages. A step that asks for something the user does not have at hand makes them abandon the flow. A step that depends on a later answer forces you to reorder the flow after release.
The goal is to make each step something a user can complete in one short, focused effort.
Start from the task, not the form
Begin with the data you need, not the layout of an existing form. List every value the flow must collect, then ask three questions about each one:
- Is it required, or can it be skipped or collected later?
- Does it depend on another answer?
- Can the user usually answer it from memory, or do they need to look something up?
The first question trims the flow. Anything you do not need at submission time is a candidate for removal or for a later screen outside the flow. The second question finds branches, which the "Branching on earlier answers" chapter covers in detail. The third question affects ordering, since lookups should come late or be clearly flagged.
Grouping rules that work in practice
Group inputs by one of these relationships. Pick the one that fits the data, and avoid mixing them within a step.
| Grouping rule | Example | Why it works |
|---|---|---|
| Same subject | Street, city, postal code | Users think of these as one answer |
| Same decision | Account type and plan | One choice changes the next question |
| Same source | Values from a single document | The user opens the document once |
| Same validation dependency | Start date and end date | The rule compares the two values |
Fields that are validated against each other belong on the same step. If a rule needs both a start date and an end date, putting them on different steps means the second step must report an error about a field the user can no longer see.
How much per step
There is no fixed number of fields per step. These guidelines help:
- One decision or one subject per step.
- Roughly one to five fields. A single field is fine when the question is hard or consequential.
- Avoid steps that need scrolling on a small phone screen.
- Avoid steps with only a trivial field, such as a lone confirmation checkbox, unless it carries legal weight.
Too many steps is also a failure. Each transition costs the user a click and a moment of reorientation. If a flow has fifteen steps with one field each, most of that is overhead.
Order steps to reduce abandonment
Order affects whether users finish. Use these defaults and break them only with a reason.
- Put easy, familiar questions first. Early progress builds momentum.
- Put questions that determine branches early, so the path is known sooner.
- Put sensitive or effortful questions after the user has invested in the flow, but not so late that a failure there wastes everything.
- Put the review step last, always.
There is a tension between the second and third rules. A branching question such as account type should come early, but if it is asked before the user understands why, it can feel abrupt. A short sentence of explanation under the question usually resolves this.
Represent steps as data
Once you have chosen boundaries, describe each step in a structure rather than in scattered conditionals. Each step declares what makes its inputs valid and which step follows. The code below is framework-neutral TypeScript and runs as shown.
type Data = Record<string, string>;
type Step = {
id: string;
validate(data: Data): string[];
next(data: Data): string | null;
};
const steps: Record<string, Step> = {
account: {
id: "account",
validate: (d) =>
/^\S+@\S+\.\S+$/.test(d.email ?? "") ? [] : ["Enter a valid email address."],
next: (d) => (d.accountType === "business" ? "company" : "review"),
},
company: {
id: "company",
validate: (d) => ((d.company ?? "").trim() ? [] : ["Enter your company name."]),
next: () => "review",
},
review: {
id: "review",
validate: () => [],
next: () => null,
},
};Three design choices in this code are worth noting.
First, steps are keyed by a stable id. Navigation, saved drafts, and tests all refer to steps by id, so renaming a step's title never breaks them. Do not use array positions as identifiers, because a branch changes what position means.
Second, validate returns a list of messages, and an empty list means valid. This keeps the step's rule next to the step's inputs. The later chapter "Validating each step before advancing" builds on this.
Third, next is a function of the collected data. A step does not know its position in the sequence. It only knows what comes after it given the answers so far. A final step returns null, which signals that no step follows.
Because the structure is plain data, you can read the whole flow in one place. A reviewer can see that business accounts get a company step and personal accounts skip it, without tracing event handlers.
Common mistakes in step design
Splitting by database table
A common shortcut is to make one step per table or API payload. The resulting steps follow your storage model, not the user's mental model. A user does not think "billing record, then contact record". They think "who I am, then how I pay". Design for the user, then map answers to storage at submission.
Hiding a dependency across steps
If step four needs a value only to validate against step two, the user gets an error about something they entered long ago. Move the related fields together, or restructure so that step four asks for the dependent value directly.
Asking for data you will not use
Each field adds friction and a reason to quit. If no later step, branch, or submission field uses a value, remove it. This is the cheapest improvement you can make to a flow.
Making the first step heavy
The first step sets expectations. A long first step with a hard question tells users the whole flow will be hard. Open with something they can answer in seconds.
Treating every optional field as a step
Optional fields can often share a step with required ones, labeled clearly as optional. A dedicated step for one optional field adds a click for little value.
A worked decomposition
Suppose you must collect these values for a signup: email, password, account type, company name, company size, billing country, and tax number. A first attempt might put all seven on one page. Here is a better split using the rules above.
- Account: email, password, account type. These are familiar, quick, and the account type decides the branch.
- Company (business only): company name, company size. Same subject, and only needed on one branch.
- Billing: billing country, tax number. Same decision, since the country determines whether the tax number is required.
- Review: read-only summary of everything, with a submit action.
Notice three outcomes. The tax number sits with the country because the rule links them. The company fields are shown only when relevant, so personal users see a three-step flow. The password lives on the first step even though it is sensitive, because the account cannot exist without it and users expect it there.
A personal user passes through account, billing, and review. A business user passes through account, company, billing, and review. Both paths end at review, which means the review step must handle both shapes of data. That requirement is easy to forget, so check it at design time.
Checking your split
Before writing any UI, run these checks on the step list.
- Can you state each step's purpose in one short sentence without using "and" more than once?
- Does every field in a step get validated using only data from that step or earlier steps?
- Does every step have a clear next step for every possible set of answers, including unexpected ones?
- Does every path end at the review step?
- Could a user who stops at any step explain what they have done so far?
If a check fails, adjust the boundaries now. Changing boundaries after the state, validation, and tests exist costs far more than changing a list on paper.
Summary of decisions
| Decision | Default | Break it when |
|---|---|---|
| Fields per step | One to five | One field is consequential or complex |
| First step | Easy and familiar | The first question determines everything |
| Branch questions | Early | The user needs context first |
| Step identity | Stable string id | Never |
| Validation location | Beside the step's inputs | Rules span steps, then regroup the fields |
Exercise
A flow collects a project start date on step 2 and an end date on step 5. The rule is that the end date must be after the start date. What is wrong with this split, and how would you fix it?
Show answer
The rule compares two values that sit on different steps, so an error on step 5 refers to a field the user entered earlier and cannot see. Fix it by moving both dates onto the same step, because fields validated against each other belong together. If they cannot move, the step that holds the second date must show the first date and let the user edit it.
Exercise
Using the signup example, a personal user and a business user both reach the review step. Name one thing the review step must handle because of the branch, and explain why using step ids matters if you later insert a new step.
Show answer
The review step must handle data that may lack company fields, so it should show the company section only when those values exist. Step ids matter because navigation, saved drafts, and tests refer to steps by id. Inserting a step changes positions but not ids, so existing drafts and tests still point to the correct screens.