Micro-interactions

Focuses on small, delightful animations that provide feedback and guide users. Every tap, swipe, and hover has a response.

Palette & CSS ↓

Live demo

◉
Pulse
Alex Chen@alexchen· 2h

Just shipped a new feature! The micro-interactions make everything feel so alive 🚀

Sarah Miller@sarahm· 2h

Love how this app responds to every tap. It's like having a conversation with the interface.

About Micro-interactions

Focuses on small, delightful animations that provide feedback and guide users. Every tap, swipe, and hover has a response.

Era / origin

2020s Modern

Key characteristics

  • Small animations
  • Gesture-based
  • Tactile feedback
  • Subtle animations
  • Contextual

When to use Micro-interactions

  • Mobile apps
  • Touchscreen UIs
  • Productivity tools
  • Consumer apps

When to avoid it

  • Critical performance
  • Formal or somber contexts
  • Motion-sensitive audiences

Common industries

  • SaaS
  • E-commerce
  • Startup & Tech

Micro-interactions color palette

  • #6366F1
  • #8B5CF6
  • #22C55E
  • #EF4444
  • #F59E0B

How to build Micro-interactions in CSS

Effects: Quick hover feedback (100-150ms), a pop when toggled on, loading spinners, success/error animations

CSS · 70 lines
:root {
  --mi-indigo: #6366F1;
  --mi-violet: #8B5CF6;
  --mi-success: #22C55E;
  --mi-error: #EF4444;
  --mi-warning: #F59E0B;
  --mi-indigo-strong: #4F46E5;
  --mi-error-strong: #DC2626;
  --mi-fast: 100ms;
  --mi-medium: 150ms;
}

.button {
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 9999px;
  background: var(--mi-indigo-strong);
  color: #FFFFFF;
  font-weight: 600;
  transition: transform var(--mi-fast) ease, box-shadow var(--mi-fast) ease;
}

.button:hover { transform: scale(1.05); box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3); }
.button:active { transform: scale(0.95); }

.button:focus-visible,
.icon-button:focus-visible { outline: 3px solid var(--mi-violet); outline-offset: 3px; }

.card {
  border-radius: 1rem;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform var(--mi-medium) ease, box-shadow var(--mi-medium) ease;
}

.card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); }

/* Hover is a quick nudge; the bigger pop is reserved for toggling on (e.g. aria-pressed) */
.icon-button { transition: transform var(--mi-fast) ease; }
.icon-button:hover { transform: scale(1.1); }
.icon-button[aria-pressed="true"] { color: var(--mi-error-strong); animation: pop 300ms ease; }

/* Feedback after an action: add the class, remove it on animationend */
.is-success { animation: pop 300ms ease; color: #15803D; }
.is-error { animation: shake 300ms ease; color: var(--mi-error-strong); }

.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-top-color: var(--mi-indigo);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes pop { 50% { transform: scale(1.3); } }
@keyframes shake { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .card,
  .button,
  .icon-button { transition: none; }
  .card:hover,
  .icon-button:hover { transform: none; }
  .icon-button[aria-pressed="true"],
  .is-success,
  .is-error { animation: none; }
  .spinner { animation-duration: 2s; }
}

Use Micro-interactions with an AI coding agent

Paste this into Claude Code, Cursor, v0, Lovable or any coding agent to restyle a page in Micro-interactions.

AI prompt · 86 lines
Apply the Micro-interactions style to this interface.

What it is: Focuses on small, delightful animations that provide feedback and guide users. Every tap, swipe, and hover has a response.
Look and feel: Small animations, Gesture-based, Tactile feedback, Subtle animations, Contextual.
Colors: primary #6366F1, #8B5CF6; secondary #22C55E, #EF4444, #F59E0B.
Effects and motion: Quick hover feedback (100-150ms), a pop when toggled on, loading spinners, success/error animations.

Reference CSS (put these class names on the matching elements, or map them onto existing components and class names; avoid long structural selectors):
```css
:root {
  --mi-indigo: #6366F1;
  --mi-violet: #8B5CF6;
  --mi-success: #22C55E;
  --mi-error: #EF4444;
  --mi-warning: #F59E0B;
  --mi-indigo-strong: #4F46E5;
  --mi-error-strong: #DC2626;
  --mi-fast: 100ms;
  --mi-medium: 150ms;
}

.button {
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 9999px;
  background: var(--mi-indigo-strong);
  color: #FFFFFF;
  font-weight: 600;
  transition: transform var(--mi-fast) ease, box-shadow var(--mi-fast) ease;
}

.button:hover { transform: scale(1.05); box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3); }
.button:active { transform: scale(0.95); }

.button:focus-visible,
.icon-button:focus-visible { outline: 3px solid var(--mi-violet); outline-offset: 3px; }

.card {
  border-radius: 1rem;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform var(--mi-medium) ease, box-shadow var(--mi-medium) ease;
}

.card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); }

/* Hover is a quick nudge; the bigger pop is reserved for toggling on (e.g. aria-pressed) */
.icon-button { transition: transform var(--mi-fast) ease; }
.icon-button:hover { transform: scale(1.1); }
.icon-button[aria-pressed="true"] { color: var(--mi-error-strong); animation: pop 300ms ease; }

/* Feedback after an action: add the class, remove it on animationend */
.is-success { animation: pop 300ms ease; color: #15803D; }
.is-error { animation: shake 300ms ease; color: var(--mi-error-strong); }

.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-top-color: var(--mi-indigo);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes pop { 50% { transform: scale(1.3); } }
@keyframes shake { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .card,
  .button,
  .icon-button { transition: none; }
  .card:hover,
  .icon-button:hover { transform: none; }
  .icon-button[aria-pressed="true"],
  .is-success,
  .is-error { animation: none; }
  .spinner { animation-duration: 2s; }
}
```

Works best for: Mobile apps, Touchscreen UIs, Productivity tools, Consumer apps.
Avoid it for: Critical performance, Formal or somber contexts, Motion-sensitive audiences. If this product falls into one of those, say so before restyling.

Keep the existing content and layout. Restyle it with the colors and CSS above, and add the interactions described.
Meet WCAG AA contrast: where a palette color is too light or bright for text, keep it for backgrounds, borders and large display type and use a darker text color, rather than darkening the whole design. Keep visible focus states, give icon-only controls an accessible name (aria-label) and respect prefers-reduced-motion.

Rolling AI coding agents out across a team? Farad Labs runs hands-on AI training.