Sub topic 5
Constraints and Natural Mapping
This chapter covers two ideas that sit between affordances and signifiers: constraints, which limit what a user can do, and natural mapping, which makes the relationship between a control and its effect easy to read. It assumes you have read the earlier chapters on the interaction loop, conceptual models, affordances, and signifiers. It also assumes you can read basic HTML and CSS.
Why constraints and mapping matter
Signifiers tell users what is possible. Constraints reduce the number of wrong things users can do. Mapping tells users which control affects which part of the system. Together they shrink both gulfs from the interaction loop:
- Constraints narrow the gulf of execution. Fewer valid actions means fewer ways to choose wrongly.
- Mapping narrows the gulf of evaluation and the gulf of execution. A user can look at a control and predict its effect, and can look at a result and tell which control caused it.
Good constraints and mapping reduce the need for instructions, error messages, and memory. Knowledge about how to act is placed in the interface, not in the user's head.
Constraints
A constraint is a limit on the actions available at a given moment. Donald Norman describes four kinds. Each has a direct interface equivalent.
| Kind | Meaning | Interface example |
|---|---|---|
| Physical | The shape or mechanics of the object block some actions | A USB-C plug fits in either orientation. A memory card slot with a notched corner accepts the card one way only |
| Semantic | The meaning of the situation rules out some actions | A "Reply" button is not offered on a message you sent to yourself in a draft folder |
| Cultural | Shared conventions limit what people expect | A red button means stop or delete. A link is underlined or colored differently from body text |
| Logical | Reasoning leaves only one possibility | Only one option is left in a list, so it is selected automatically |
On screens, physical constraints are rare, because pixels have no shape. Interfaces use software equivalents: disabled controls, input masks, restricted pickers, and ordering rules. These are the constraints you will implement most often.
Constraining input
Choose the control whose shape matches the valid data. Each input type removes a class of mistakes.
| Data | Weak choice | Constrained choice | What it prevents |
|---|---|---|---|
| Date | Free text field | Date picker | Wrong formats such as 03/04 (March 4 or April 3?) |
| One of three sizes | Free text field | Radio buttons | Typos and unknown values |
| Quantity from 1 to 10 | Free text field | Number input with `min` and `max` | Letters, negatives, and zero |
| Country | Free text | Searchable list | Misspellings and variants such as "UK" or "United Kingdom" |
The HTML below uses native constraints. The browser enforces them and reports problems without any JavaScript.
<form>
<label for="qty">Quantity (1 to 10)</label>
<input id="qty" name="qty" type="number" min="1" max="10" step="1" value="1" required>
<label for="when">Delivery date</label>
<input id="when" name="when" type="date" min="2026-12-01" required>
<button type="submit">Order</button>
</form>The min and max attributes act as the constraint, and the number input's spinner buttons and keyboard arrows stop at those limits. The date picker removes any chance of a malformed date.
Constraining actions by state
A second kind of constraint depends on state. An action that cannot succeed right now is blocked or hidden. Two techniques are common, and they behave differently.
- Disabling keeps the control visible but inert. Users see that the action exists, which supports the conceptual model.
- Hiding removes the control. Users never see the action, so they cannot discover it or ask why it is unavailable.
Disabling has a cost. A disabled button gives no explanation, and many users cannot tell why it is grey. The fix is to pair the constraint with a reason that is visible in text.
<button id="submit" type="submit" disabled aria-describedby="why">Place order</button>
<p id="why">Add at least one item to your cart to place an order.</p>The aria-describedby attribute links the button to its explanation, so a screen reader announces both. Chapter 10 covers accessible cues in detail.
Forcing functions
A forcing function is a constraint that makes the user do something before they can continue. Norman names three types:
- Interlock: one step must finish before the next can start. A wizard that disables "Next" until required fields are valid is an interlock.
- Lock-in: the system keeps the user in an operation until it is safe to leave. An editor that warns about unsaved changes before the tab closes is a lock-in.
- Lockout: the system blocks an entry that would be harmful. A password field that refuses a known-breached password is a lockout.
Forcing functions protect users, but they also add friction. Use them where a mistake is costly or hard to undo. Do not use them to enforce preferences. A lock-in that fires on every navigation trains users to dismiss it without reading.
Choosing between prevention and correction
You can stop an error before it happens or help the user repair it afterward. Prevention is usually better, but it has limits.
- Prevent when the valid set is small and known, such as dates, quantities, and enumerated choices.
- Allow and then explain when the valid set is large or when your rules might be wrong. Names, street addresses, and phone numbers vary too much for strict masks. A rule that rejects a real name is worse than the typo it was meant to catch.
Chapter 9 covers the second case, writing the message and recovery path.
Natural mapping
Mapping is the relationship between a control and its effect. Natural mapping uses spatial layout or familiar analogy so that the relationship is obvious without a label.
Norman's classic example is a stove. If four burners sit in a square and four knobs sit in a row, a user must learn or guess which knob controls which burner. If the knobs are laid out in the same square arrangement, the layout itself says which is which. The knob is mapped to the burner by position.
Mapping is stronger when the arrangement of controls mirrors the arrangement of the things they control. It is weaker when it depends on labels, numbering, or memory.
Kinds of mapping in software
Software has no physical layout to copy, so natural mapping comes from several sources.
- Spatial mapping. Place a control next to what it changes. A "Delete" icon at the end of each row affects that row. A single "Delete" button at the top of the page is ambiguous unless a row is clearly selected.
- Directional mapping. Up means more, right means forward or later. A volume slider that increases to the right follows this. A vertical slider where "up" lowers the value does not.
- Visual correspondence. The control resembles the result. A text-alignment toolbar uses icons whose lines lean left, center, or right.
- Order correspondence. The sequence of controls matches the sequence of the content. Tabs at the top appear in the same order as the sections below them.
- Live preview. The result changes as the user manipulates the control, so cause and effect are seen together. A color picker that updates a swatch while you drag is a strong mapping.
A worked example: a settings screen
Consider a screen with two panels. The left panel shows a preview of a profile card. The right shows the settings.
A weak design places all "Save" and "Reset" buttons at the bottom of the page, and a single toggle row labeled "Dark mode, compact view, show email" with three unlabeled switches. A user must count switches to decide which is which.
A stronger design:
- Puts one labeled switch per row, with the label to the left of its switch.
- Updates the preview at once when a switch changes.
- Places "Reset" beside the group of settings it resets, not at the page bottom.
The following code shows the live-preview mapping. Each switch changes a class on the preview, so the user sees the effect of every control.
<div id="preview" class="card">
<p class="name">Ada Lovelace</p>
<p class="email">[email protected]</p>
</div>
<fieldset>
<legend>Display</legend>
<label><input type="checkbox" id="compact"> Compact layout</label>
<label><input type="checkbox" id="hideEmail"> Hide email</label>
</fieldset>
<style>
.card { padding: 1.5rem; border: 1px solid #c7ccd4; border-radius: 6px; }
.card.compact { padding: 0.5rem; }
.card.hide-email .email { display: none; }
fieldset label { display: block; margin: 0.5rem 0; }
</style>
<script>
const preview = document.getElementById("preview");
document.getElementById("compact").addEventListener("change", (event) => {
preview.classList.toggle("compact", event.target.checked);
});
document.getElementById("hideEmail").addEventListener("change", (event) => {
preview.classList.toggle("hide-email", event.target.checked);
});
</script>Here each checkbox sits next to its own label, and the preview responds on the same screen. The user does not need to save to learn what a setting does.
Common errors
These patterns come up often in reviews.
- Controls far from their targets. A filter bar at the top of a long page changes content far below, and nothing signals that anything changed. Move the control closer, or add feedback that points at the result.
- Reversed direction. A slider or stepper where the visual direction contradicts the value direction. Some interfaces reverse direction deliberately, such as a "scroll" setting. When they do, the label must say what happens.
- Ambiguous scope. A toolbar button that could apply to the whole document or to the selection. Show the current scope in the interface, for example by highlighting the selection.
- Disabled with no reason. Disabling is a valid constraint, but unexplained disabling looks like a bug.
- Over-constraining. A strict input mask rejects valid data, such as a phone number with an extension. A constraint is only helpful when it matches reality.
- Under-constraining. A free text field for a value with ten valid options. Users type "N/A", "none", or "-", and you must clean up the data later.
- Hiding what should be disabled. A menu where unavailable commands vanish makes the menu change shape between contexts. Users cannot build a stable model of it. In menus, disabling usually works better than hiding. In dense toolbars, hiding may be necessary for space, and you should keep the order of remaining items stable.
How constraints and mapping relate to earlier ideas
- Affordances describe what an object permits. Constraints remove permitted actions that are not useful.
- Signifiers show what remains. A disabled style and a visible reason are signifiers of a constraint.
- Feedback confirms that a constrained action was blocked. Without it, a user who clicks a disabled button learns nothing.
- The conceptual model is clearer when mapping is natural, because the user can infer the structure of the system from the layout.
Checking a design
When you audit a screen for the final chapter, use these questions for constraints and mapping.
- For each input, could a smaller set of choices work? Is the control type matched to the data?
- For each blocked action, is the reason visible in text?
- Does each control sit near, or visibly point at, the thing it changes?
- Does direction (up, right, more) match the direction of the change?
- Does the result of a control change appear at once, or does the user need to guess?
- Are any constraints stricter than the real data allows?
Exercise
A checkout form has a free-text "Country" field and a "Pay now" button that is disabled until every field is valid. Users complain that the button "doesn't work". Name two constraint changes that would fix the problems, and say which kind of error each one addresses.
Show answer
First, replace the free-text Country field with a searchable list. This is a prevention constraint that removes misspellings and variants such as "UK" and "United Kingdom". Second, explain the disabled button. Add visible text, linked with aria-describedby, that names the missing or invalid fields (for example "Enter a valid postal code to continue"), and mark those fields. This does not remove the interlock, which is a sensible forcing function. It fixes the missing signifier and feedback that make the button look broken.
Exercise
A video editor has three sliders for brightness, contrast, and saturation, placed together at the bottom of the window. The image preview sits at the top. The sliders are in the order contrast, brightness, saturation, and their labels appear in a different order in the help page. Describe two mapping problems and one improvement for each.
Show answer
Problem one is the distance between controls and effect. The sliders sit at the bottom and the image at the top, so users must look back and forth, and a small change may be hard to see. Improvement: update the preview live while dragging, and place the controls beside the preview. Problem two is inconsistent order. The sliders' order differs from the help page order, which breaks order correspondence and makes the help harder to follow. Improvement: use the same order in the interface and documentation, and place the most common control first.
Exercise
Give one case where hiding an unavailable command is better than disabling it, and one case where disabling is better.
Show answer
Hiding is better when the action can never apply to this user or context, such as an "Admin settings" link for a regular account, because showing it adds clutter and invites pointless attempts. Disabling is better when the action is available in principle but not right now, such as "Undo" with an empty history in a menu, because the user keeps a stable menu layout and learns that the action exists. In both cases, tell users the reason where a disabled control could confuse them.