Sub topic 10
Making Cues and Feedback Accessible
Assume you know basic HTML and CSS and have used web or mobile interfaces. This chapter focuses on applying interaction design principles to people who use keyboards, screen readers, magnification, touch input, or reduced-motion settings.
Accessibility means that a person can discover an action, perform it, and understand its result through more than one sensory channel. A visual cue alone is not a reliable signifier. A color change alone is not reliable feedback.
Make signifiers perceivable
A signifier is a cue that communicates what an interface element does. A button should look and behave like a button. A link should identify a destination. An input should have a visible label.
Accessible signifiers should meet these requirements:
- Give every control an accessible name. A visible label is usually best.
- Use native HTML elements when possible. A real
<button>already supports keyboard operation and communicates its role to assistive technology. - Keep keyboard focus visible. Do not remove the browser outline without adding an equivalent or stronger indicator.
- Do not use color as the only difference between states. Add text, an icon with a label, an outline, or another visible change.
- Provide enough contrast between text, controls, and their background.
- Make touch targets large enough to activate without precise pointing.
- Preserve meaning when users zoom the page or use high-contrast settings.
The control's appearance should agree with its state. A disabled button should not look available. A selected tab should have a non-color indicator such as an underline or border.
.primary {
cursor: pointer;
background: #0b5fff;
color: #fff;
border: 0;
border-radius: 6px;
padding: 0.5rem 1rem;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.primary:hover { background: #0a4fd6; }
.primary:focus-visible {
outline: 3px solid #ffbf47;
outline-offset: 2px;
}
.primary:active {
transform: translateY(1px);
box-shadow: none;
}
.primary:disabled {
background: #c7ccd4;
color: #555;
cursor: not-allowed;
box-shadow: none;
}The :focus-visible rule is especially important for keyboard users. The focus ring shows where the next keyboard action will occur. The hover state cannot perform this job because keyboard users may never produce a hover event.
Make feedback perceivable
Feedback closes the gulf of evaluation: the gap between what the system did and what the user can understand about it. Accessible feedback communicates through a suitable combination of visual, textual, auditory, and sometimes haptic channels.
A status message should be placed near the action visually and exposed to assistive technology. The role="status" attribute creates a polite live region. A live region is an area whose changed text can be announced by a screen reader without moving the user's focus.
<button id="save" type="button">Save</button>
<p id="status" role="status" aria-live="polite"></p>
<script>
const button = document.getElementById("save");
const status = document.getElementById("status");
button.addEventListener("click", async () => {
button.disabled = true;
status.textContent = "Saving…";
try {
const response = await fetch("/api/save", { method: "POST" });
if (!response.ok) throw new Error("HTTP " + response.status);
status.textContent = "Saved.";
} catch (error) {
status.textContent =
"Could not save. Check your connection and try again.";
} finally {
button.disabled = false;
}
});
</script>This example provides several cues at once:
- The disabled state prevents duplicate submissions.
- “Saving…” tells the user that the action started.
- “Saved.” confirms success.
- The error text explains that the operation failed and suggests a recovery step.
- The status region lets a screen reader announce changes without stealing focus.
Do not use aria-label to hide a useful visible label. Do not use aria-live as a replacement for visible feedback. Assistive technology support varies, so important information should remain available on screen.
Match feedback to the action
Feedback should be immediate enough to confirm that the system received the action, but its detail should match the operation.
| Operation duration | Suitable feedback | Example |
|---|---|---|
| Less than a second | State change or brief confirmation | A checkbox becomes checked |
| About one to several seconds | Pending status and temporary disabled state | “Saving…” |
| Longer or uncertain | Progress indication with useful updates | “Uploading 3 of 8 files” |
| Failed operation | Error, cause when known, and recovery action | “File is too large. Choose one under 10 MB.” |
Progress indicators must not imply false precision. Use a determinate percentage only when the system can calculate it. Otherwise, use an indeterminate indicator with a text status.
Motion can reinforce feedback, but it must not be required to understand it. Respect the user's reduced-motion preference:
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms;
animation-iteration-count: 1;
scroll-behavior: auto;
transition-duration: 0.01ms;
}
}Design errors for recovery
An error message should answer three questions:
- What happened?
- Which input or operation caused it?
- What can the user do next?
“Invalid input” gives too little information. “Enter an email address such as [email protected]” identifies the expected format. Associate the message with the relevant field using aria-describedby, and do not rely only on a red border or an error icon.
For errors that affect the whole operation, put the message near the action and announce it. Keep the user's entered data whenever possible. Recovery is part of the interaction, not an afterthought.
Audit the accessible interaction
Test the complete loop:
- Can a keyboard user find every actionable control?
- Is the current focus clear?
- Can a screen reader identify each control and hear important status changes?
- Does every color cue have another equivalent?
- Can users understand success, failure, and pending states without sound or motion?
- Does each error explain how to recover?
- Does the interface remain usable when zoomed or viewed with reduced motion?
Exercise
A form changes a button from blue to gray while saving, but provides no text and never announces completion. What should you change?
Show answer
Keep the visible state change, add a clear pending label such as “Saving…”, disable the button to prevent duplicate submissions, and expose a nearby status region that announces success or an actionable error.