Writing

A field guide to microinteractions

Most microinteractions fail by being noticed. A catalog of the ones that work: feedback that answers a question the user already had, motion that explains where things went, and nothing else.

There's a particular species of portfolio site where everything moves. Cards tilt in 3D when you hover them, gradients chase your cursor, sections parallax past each other at six different speeds. Every interaction is a small fireworks display, and after thirty seconds you're exhausted and you've learned nothing about the person whose work you came to see.

The problem isn't motion. It's motion that talks about itself.

A microinteraction earns its place when it answers a question the user already had: Did that click register? Where did this panel come from? Can I press this? The moment an animation exists to be admired rather than to answer, it has become decoration — and decoration that intercepts input is worse than none.

Here is the working catalog, roughly in order of how much value they carry per millisecond of duration.

1. State you can see

The cheapest and most important: every interactive element visibly changes under hover, focus, and press. Not with a bounce — with a state. A button darkens two percent and lifts a pixel; a link's underline draws itself from left to right:

.ink-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 250ms cubic-bezier(0.32, 0.08, 0.24, 1);
}
.ink-link:hover {
  background-size: 100% 1px;
}

Two hundred and fifty milliseconds, one property, no JavaScript. The user never thinks "what a lovely underline." They just never wonder whether the thing they're pointing at is a link.

2. Motion that explains

When something appears, the user needs to know where it came from — not as trivia, but so their eyes don't have to search. A dropdown fades from its trigger. A mobile sheet slides from the edge it will leave by. A dialog scales up by four percent, which reads as "came toward you" without reading as "animation."

The rule I keep: motion should trace a path the element could plausibly have traveled. Anything else is the interface doing a magic trick, and magic tricks invite the audience to watch the magician instead of the card.

3. Feedback that confirms

Forms are where microinteractions do real work. A field that validates on blur with a small, quiet mark — not a modal, not a shake — converts "did I fill this in right?" from a thought into a glance. A submit button that disables, shows a spinner, then resolves to a checkmark is narrating three facts the user genuinely wants: received, working, done.

The failure mode here is latency theater: fake delays, gratuitous spinners on instant operations. If it took 40ms, don't animate it like it took two seconds. Respect the actual duration.

4. Continuity

The most sophisticated category, and the easiest to overdo. When a card in a list expands into a detail page, the shared element should travel — same image, same corner radius interpolating, position tweening between the two layouts. The user's attention is carried instead of dropped.

The web finally has this natively, and it's two lines:

/* the list thumbnail and the detail hero share a name */
.card-thumb, .detail-hero { view-transition-name: hero; }

Used once or twice per site, view transitions feel like the interface is one continuous object. Used on every navigation, they feel like seasickness.

The two questions

Before adding any animation, I ask two things:

  1. What question does this answer? If the answer is "none, it's delightful" — cut it, or move it somewhere the user opted into play (a 404 page is a fine home for a firework).
  2. What happens on the tenth viewing? A detail you notice and smile at once must survive being seen a hundred times. Underlines do. Cursor-following sparkles do not.

And underneath both: prefers-reduced-motion isn't a footnote. Every animation above should sit behind a media query that turns it off, because the people who need that setting need it completely.

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

The sites I remember aren't the ones that moved the most. They're the ones where everything responded — immediately, proportionally, and quietly — so that I stopped thinking about the interface entirely and started thinking about the work.