Microinteractions are the small, single-purpose animations and feedback moments that respond to a user action. A button that pulses when clicked. A form field that gently shakes when validation fails. A toggle that slides with a satisfying snap. Individually they seem trivial. Collectively they are what separates a good UI from a great one.
Why Microinteractions Matter
Users do not consciously notice good microinteractions — but they notice their absence. Without feedback, interfaces feel flat, unresponsive, and untrustworthy. With them, the same interface feels alive, polished, and confident.
The functional case is equally strong. Microinteractions:
- Confirm that an action was received (button press acknowledged)
- Communicate system state (loading, success, error)
- Guide attention to what changed
- Prevent errors by providing immediate validation feedback
- Delight users in ways that build brand loyalty
The Four Components of a Microinteraction
Designer Dan Saffer's model breaks every microinteraction into four parts:
- Trigger — what initiates the microinteraction (user action or system event)
- Rules — what happens as a result
- Feedback — how the user is made aware of what is happening
- Loops and modes — what happens over time or on repetition
Understanding this structure helps you design intentionally rather than decoratively.
Button States
A button has at minimum five states that should be visually distinct:
- Default — resting state
- Hover — subtle scale-up or glow (desktop only)
- Focus — visible focus ring for keyboard navigation (accessibility requirement)
- Active/Pressed — slight scale-down to simulate a physical press
- Disabled — reduced opacity, cursor: not-allowed
With Framer Motion:
<motion.button
whileHover={{ scale: 1.05, boxShadow: '0 0 20px rgba(59,130,246,0.4)' }}
whileTap={{ scale: 0.97 }}
transition={{ type: 'spring', stiffness: 400, damping: 25 }}
>
Submit
</motion.button>Form Validation Feedback
Validation error messages that appear are 10× more noticeable when accompanied by a subtle shake animation on the input field — the same pattern used by iOS when you enter a wrong passcode. It communicates “something is wrong here” without words.
const shakeVariants = {
shake: {
x: [0, -8, 8, -6, 6, -4, 4, 0],
transition: { duration: 0.4 }
}
}
<motion.input
variants={shakeVariants}
animate={hasError ? 'shake' : ''}
/>Loading States
A button that shows a spinner while processing prevents double-submits and communicates that the system is working. The transition into and out of loading state should be smooth:
- Text fades out, spinner fades in (use AnimatePresence)
- Button width stays stable — avoid layout jumps when content changes
- Return to default state smoothly after completion
Toggle Switches
A toggle that snaps instantly feels cheap. The same toggle with a spring-physics slide and a subtle scale on the thumb feels premium. The difference is less than 200 milliseconds of animation — but the perceived quality difference is enormous.
Success States
Completing a significant action (submitting a form, completing a purchase) deserves a moment of celebration. A checkmark that draws itself. A brief confetti burst. A success card that scales up with a spring. These moments are brief but memorable — they are part of how users remember feeling good about using your product.
The Rules of Restraint
Microinteractions go wrong when there are too many of them, or when they are too long:
- Duration — most microinteractions should be 150–300ms. Over 400ms feels slow. Under 100ms is imperceptible
- Frequency — not everything needs animation. Reserve motion for actions that benefit from feedback
- Respect reduced motion — always check
prefers-reduced-motionand reduce or eliminate animations for users who need it - Purpose first — every animation should serve a function. If you cannot name what it communicates, cut it
The best microinteractions are invisible in the best possible way — users do not think “nice animation,” they think “this app feels solid.” That feeling, built from a hundred small moments of feedback, is worth the investment.