Feedback and loading
Tell people what is happening, preserve their work and keep delayed results stable.
Try progress and cancellation
Ready to start.
View markup
<div class="spec-stack"><div class="ex-field"><label class="ex-label" for="spec-progress">Loading a sample preview</label>
<progress id="spec-progress" value="0" max="3"></progress></div>
<div class="spec-actions"><button type="button" class="ex-button ex-button--spectral" data-run>Run example</button>
<button type="button" class="ex-button ex-button--secondary" data-cancel disabled>Cancel</button></div>
<p class="spec-status" role="status" data-status>Ready to start.</p></div>Usage and implementation
Status messages
| State | Example |
|---|---|
| Pending | Saving note… |
| Success | Note saved. |
| Warning | Leaving will discard your changes. |
| Failure | Couldn’t save the note. Try again. |
| No results | No matching notes. Clear filters. |
Announce only the actual status
Use a persistent polite live region for ordinary asynchronous updates. Keep one actual status message. Hidden sizing text must be aria-hidden and must not contain controls. Important information should not disappear in a fleeting toast.
Reserve known delayed responses naturally
A short loading message followed by a wrapping result can shift the rest of the page. Reserve the largest known response with a natural grid and invisible sizing copies. Let the grid grow with text preferences and content; avoid fixed heights.
If a result includes a name or other user input, calculate its reservation before the asynchronous action finishes. Updating the reservation after success can reintroduce a delayed shift.
Keep persistence claims accurate
“Saved” should mean the intended storage boundary actually succeeded. A local demo must say when data remains only in memory. Test refresh and the receiving surface when persistence is part of the product.
