Sub topic 7
Deciding what goes in each step
This chapter assumes you can group fields with fieldset and legend, and that you know how conditional fields are hidden and excluded from the payload. Here you decide where to cut a long form into steps and what each step contains. The next chapter turns those decisions into a state machine.
Why decomposition is a design decision
Splitting a form into steps does not shorten it. The user answers the same questions, but the form shows fewer at a time. Each split has costs: extra clicks, a hidden total length, and more state to carry. Split only when it buys something.
A split is usually worth it in these cases:
- The form has more than about 10 to 12 fields, or fields from clearly different topics.
- Later questions depend on earlier answers, and showing them all at once would be confusing.
- Some information is hard to find, such as a tax ID or a document number, and you want users to be able to pause at that point.
- Validation or a server call is needed before the next questions make sense, for example checking whether an email already has an account.
A split is usually not worth it for a short form with one topic. A seven-field contact form on one page beats three steps with two or three fields each.
Principles for assigning fields to steps
Group by topic the user recognizes
Use the user's mental model, not your database schema. Users think "who I am", "where to send it" and "how I pay". They don't think "the users table" and "the addresses table". If your data model forces a different order, such as needing an account ID before creating an order, keep the model's order out of the interface.
Keep dependent questions together or in order
A field that controls another field should come before it. Ideally both are in the same step, so the user sees the effect of the answer right away. If the controlling field is in step 1 and the dependent field is in step 4, the user won't connect them, and changing the early answer later can silently invalidate the later one (see the section on conditional steps below).
One decision or one cohesive task per step
A useful test is whether you can name the step with a short noun phrase: "Shipping address", "Payment". If you need "and" in the title, the step probably holds two tasks.
Front-load low effort and high certainty
Put easy questions first. Users who have answered a few easy questions are more likely to continue through harder ones. Put the most effortful or sensitive requests, such as document uploads or payment, where users have the most commitment, but don't hide them. Tell users near the start what they will need, such as "You'll need your passport number."
Ask only what you need
Every field costs completion rate. For each field, ask whether you can derive it, defer it until after sign-up, or drop it. Removing a field is better than moving it into a step.
Balance step size
Steps of very different size feel unfair. A step with one field followed by a step with twelve gives a misleading progress indicator. Aim for roughly similar effort per step, not just a similar field count. A single "upload a document" field can be heavier than five text fields.
A decision process
The diagram shows one way to assign each field.
Run this for every field, then review the result as a whole: count the steps, compare their weight, and check that no controlling field comes after the field it controls.
Worked example
Take a signup flow for a delivery service. The raw field list is: email, password, full name, phone, delivery method, street address, postcode, delivery notes, card number and promo code.
- Account: email, password. This is low effort and establishes identity.
- Details: full name, phone, delivery method.
- Shipping: street address, postcode, delivery notes. This step applies only when delivery method is "ship".
- Payment: card number, promo code.
- Review: no inputs. It shows everything and offers edit links. The review step is covered in a later chapter.
Some decisions in this split:
- Delivery method sits in "Details", not in "Shipping", because it decides whether "Shipping" exists. The controlling field comes first.
- Delivery notes are optional. They stay in "Shipping" because they are about the address, but they are marked optional so users don't hesitate.
- Promo code goes with "Payment" because that is where users expect to enter it. Giving it a collapsed "Have a code?" disclosure keeps it from distracting users who have none.
Conditional steps
Conditional fields were covered earlier. The same idea applies to whole steps: a step applies only when some earlier answer says so. If you let a user change an early answer, the set of applicable steps changes, so compute it from the current values instead of storing a fixed list.
type Values = Record<string, string>;
type StepDef = {
id: string;
title: string;
fields: string[];
appliesWhen?: (values: Values) => boolean;
};
const stepDefs: StepDef[] = [
{ id: "account", title: "Account", fields: ["email", "password"] },
{ id: "details", title: "Your details", fields: ["name", "phone", "delivery"] },
{
id: "shipping",
title: "Shipping address",
fields: ["address", "postcode", "notes"],
appliesWhen: (v) => v.delivery === "ship",
},
{ id: "payment", title: "Payment", fields: ["card", "promo"] },
{ id: "review", title: "Review", fields: [] },
];
function applicableSteps(values: Values): StepDef[] {
return stepDefs.filter((s) => !s.appliesWhen || s.appliesWhen(values));
}
function findDuplicateFields(defs: StepDef[]): string[] {
const seen = new Set<string>();
const duplicates: string[] = [];
for (const def of defs) {
for (const field of def.fields) {
if (seen.has(field)) duplicates.push(field);
seen.add(field);
}
}
return duplicates;
}
console.log(applicableSteps({ delivery: "pickup" }).map((s) => s.id));
// [ 'account', 'details', 'payment', 'review' ]
console.log(applicableSteps({ delivery: "ship" }).map((s) => s.id));
// [ 'account', 'details', 'shipping', 'payment', 'review' ]
console.log(findDuplicateFields(stepDefs));
// []Declaring steps as data has three benefits. The step list drives the progress indicator, so it always matches reality. The fields arrays tell you which fields to validate on "Next". And findDuplicateFields is a cheap check, which you can run in a unit test, that no field is asked twice.
Edge cases and pitfalls
Changing an answer that removes a step
If a user completes "Shipping", goes back, and switches delivery to "pickup", the shipping step disappears. Decide what happens to the saved address. The rule from the conditional fields chapter applies: values from steps that no longer apply must not be submitted. You can either delete them immediately or keep them in memory but exclude them from the payload. Keeping them is friendlier, because the user may switch back. Excluding them is mandatory.
Changing an answer that adds a step
If the user is on "Review" and goes back to switch delivery to "ship", a new step appears behind them. Make sure the flow doesn't let them jump back to "Review" without completing it. A step is "complete" only when it applies and its fields validate.
Fields that affect many steps
Some answers, such as country, change labels, validation rules and options in several steps. Put them in the earliest step that makes sense, and tell users that changing them later may affect other answers.
Steps that require server work
If a step triggers a server call, such as an email availability check, treat it as a boundary. Keep the call at the end of the step, show a loading state on the "Next" button, and don't let the user advance on failure. Don't hide a slow call inside a step with many fields.
Too many steps
Beyond about six or seven steps, progress indicators stop helping and users start to suspect the form is endless. If you reach that count, merge related steps or move optional questions after the main task.
Comparing split strategies
| Strategy | Good for | Risk |
|---|---|---|
| Single page with grouped sections | Short or medium forms; users who want to scan everything | Intimidating if long; no natural save points |
| Topic-based steps | Mixed-topic forms with mostly independent sections | Uneven step weight |
| Branch-based steps | Forms where answers change what is needed | More states to test; surprise when steps appear or vanish |
| Progressive disclosure on one page | Mostly short forms with a few optional parts | Page height changes; harder to track completion |
Checking your decomposition
Before building, check each of these:
- Every field appears in exactly one step, or in none because you removed it.
- Every controlling field comes before, or in the same step as, the fields it controls.
- Each step has a short name with no "and".
- No step is much heavier than the others.
- A user can say what they'll need before they start.
- For every conditional step, you know what happens to its saved values when it stops applying.
Exercise
A checkout form has the fields: email, full name, "Is this a gift?" (yes/no), recipient name (only if gift is yes), street address, postcode, card number. A developer proposes three steps: (1) email, full name, recipient name; (2) "Is this a gift?", street address, postcode; (3) card number. Name two problems with this split and propose a better one.
Show answer
First, the controlling field "Is this a gift?" is in step 2 but the field it controls, recipient name, is in step 1, so the user is asked for a recipient before they have said there is one. Second, step 1 mixes the user's own identity with a gift recipient, and step 3 has only one field, so the weights are uneven. A better split is: (1) Contact: email, full name; (2) Delivery: "Is this a gift?", recipient name (shown only when gift is yes), street address, postcode; (3) Payment: card number. The controlling field now sits in the same step as the field it controls, and each step has a clear topic.
Exercise
Using the stepDefs and applicableSteps code from this chapter, a user finishes the "shipping" step with delivery set to "ship", then goes back and changes delivery to "pickup". What should happen to the saved values for address, postcode and notes, and what should the step list look like afterward?
Show answer
The step list becomes account, details, payment, review, because "shipping" no longer applies. The saved shipping values may be kept in memory in case the user switches back, but they must be excluded from the submitted payload, since they belong to a step that does not apply.