Sub topic 5
Constraints and Natural Mapping
A constraint limits what a user can do at a particular moment. A mapping connects a control to the result it produces. Together, constraints and mapping reduce guesswork in an interface.
This chapter assumes that you understand basic interface controls, HTML, and CSS. It also assumes that you can read a simple screen and describe what a user might try next.
Constraints prevent invalid actions
A good constraint makes an invalid action unavailable, or makes its cost clear before the user commits to it. Constraints can be physical, logical, semantic, or cultural.
| Constraint type | Meaning | Interface example |
|---|---|---|
| Physical | The design limits movement or input | A slider stops at its minimum and maximum |
| Logical | The available choices follow from the current state | “Next” stays disabled until required fields are valid |
| Semantic | Meaning limits what makes sense | A date-of-birth field does not accept a future date |
| Cultural | Shared conventions guide behavior | A magnifying-glass icon suggests search |
Constraints are useful when they prevent errors without hiding important choices. For example, a quantity field can reject negative numbers because a store cannot sell “minus two” items. A date picker can prevent impossible dates such as April 31.
However, a constraint can also create confusion. Disabling a control without explaining why leaves the user unable to form a useful explanation. If a button requires a completed field, show the requirement near that field or provide a message when the user tries to continue.
Use constraints without blocking recovery
Constraints should match the user's goal and the system's rules. Consider a form with a required project name:
<label for="project-name">Project name</label>
<input id="project-name" name="projectName" required>
<button type="submit">Create project</button>
<p id="hint">Enter a name to create the project.</p>The required attribute gives the browser a logical constraint. The visible hint gives the user a semantic explanation. The user can understand what is missing and how to recover.
Do not use constraints as a substitute for validation. Client-side validation helps users correct mistakes quickly, but the server must validate submitted data again. A user can bypass browser controls, and requests can come from other clients.
A constraint should also preserve a route forward. If a password rule rejects an entry, state the rule. If a file is too large, state the maximum size and offer a way to choose another file. “Invalid input” does not explain the constraint.
Natural mapping connects controls to results
Mapping is the relationship between a control's position or action and the result it produces. A natural mapping follows a familiar spatial, temporal, or conceptual relationship.
A row of stove controls arranged in the same order as the burners is easier to understand than four identical controls placed in a separate, unexplained row. A volume slider that moves left for quieter and right for louder follows a common directional convention.
Natural mapping does not mean that every interface must copy a physical object. It means that the relationship should be predictable. A digital music player can use a vertical volume slider, but it should make the direction and current value clear.
The strongest mappings combine:
- Position: the control is near the thing it changes.
- Direction: moving or pressing in one direction produces the expected change.
- Order: controls follow the order of the items they affect.
- Labels: words or values confirm the relationship.
- State: the current result is visible after the action.
This diagram shows how a user interprets a control and checks its result:
Audit constraints and mapping together
When reviewing a screen, ask these questions:
- What actions are possible right now?
- Which actions are blocked, and is the reason visible?
- Does each control appear near the content it changes?
- Does the control's direction match the result's direction?
- Can users predict the result before acting?
- Can users undo or correct the result?
- Does the interface show the new state immediately?
Imagine a settings page with a toggle labeled “Notifications.” If turning it on reveals notification controls below, the mapping is understandable when the new controls appear next to the toggle and the state changes from “Off” to “On.” If the toggle silently changes a setting on another page, the mapping is weak even if the underlying behavior is correct.
Avoid relying on position alone. Responsive layouts can move controls, and screen readers may present content in a different order. Pair spatial relationships with labels, values, and state announcements.
Exercise
A form has a “Submit” button that remains disabled until three fields are complete. Users do not know which field is missing. What should you change?
Show answer
Keep the constraint if submission truly requires all three fields, but show required labels or inline messages beside the incomplete fields. Explain what each field needs so users can recover without guessing.