Design Perceived Speed
Users judge speed by responsiveness, not by a network waterfall. A 300 ms action that paints an instant acknowledgement feels faster than a 200 ms one that shows nothing.
Procedure
Set the interaction budget: feedback must paint within 100 ms of a tap. Below that, a control feels attached to the finger.
For network-bound views, render a skeleton that matches the final layout's shape and dimensions rather than a centred spinner.
For writes (like, save, follow), apply the change optimistically and reconcile on response:
setLiked(true); await api.like(id).catch(() => setLiked(false));For renders over 50 ms, keep the previous content visible and swap on completion; never blank the page.
Use
transitiononopacity/transformonly, and gate motion behind@media (prefers-reduced-motion: no-preference).Add a deliberate delay only when it is honest: a 400 ms "Saving" that resolves faster than the eye can track at least confirms the tap.
Show progress with position, not a looping indeterminate bar, once an operation exceeds roughly 10 s.
Keep the tab title and favicon responsive too; a background render that freezes the spinner communicates nothing.
Measure the perceived gap by hand: tap a control, count the milliseconds until the first pixels change, and treat anything over 100 ms as a bug.
Pitfalls
- Spinners that flash for 80 ms and vanish read as a glitch; hold a skeleton for a minimum visible duration or skip it.
- Optimistic updates with no rollback, so a failed write leaves the UI lying about state.
- Skeletons with a different height than the loaded content, which reintroduces layout shift.
- Blocking the whole page on an above-the-fold fetch instead of streaming the rest.
- Animating layout properties (
top,width) which stutter on mid-tier hardware and read as slow.
Verification
npx lighthouse https://shop.example.com --only-categories=performance --preset=desktop --quiet --output=json | jq '.audits."first-contentful-paint".numericValue'
FCP under 1800 ms plus a sub-100 ms interaction handler budget. Report the FCP number and the interaction you measured by hand.