|$ curl https://forge-ai.dev/api/markdown?path=docs/components/animations
$cat docs/animations-&-micro-interactions.md
updated Recently·22 min read·published

Animations & Micro-interactions

CSSHTMLTailwindBootstrapUIAnimationAdvanced🎯Free Tools
Motion in Modern UI

Animation is not decoration — it guides attention, confirms actions, and makes interfaces feel alive. This guide covers real transitions used in modern design systems: micro-interactions, page transitions, skeleton shimmers, staggered lists, and spring-like easing.

info

Keep micro-interactions between 150ms and 300ms. Slower feels sluggish; faster feels invisible. Always respect prefers-reduced-motion.
Button Micro-interactions

Buttons should respond to hover, focus, and active states with subtle transform and shadow changes. A small lift on hover and a pressed scale on active gives tactile feedback.

button-motion
Live
untitled.html
HTML
1<div class="group">
2 <button class="btn lift">
3 Hover Lift
4 </button>
5 <button class="btn press">
6 Press Scale
7 </button>
8 <button class="btn glow">
9 Glow Pulse
10 </button>
11 <button class="btn ripple">
12 Ripple
13 </button>
14</div>
preview
Card Transitions

Cards benefit from lift, glow, and content reveal on hover. Keep the layout stable — animate only transform and opacity to avoid expensive reflows.

card-motion
Live
untitled.html
HTML
1<div class="card">
2 <div class="card-img">
3 </div>
4 <div class="card-body">
5 <h3 class="card-title">
6 Hover Me
7 </h3>
8 <p class="card-desc">
9 Lift + glow + content slide.
10 </p>
11 </div>
12</div>
preview
Skeleton Shimmer

Skeleton loaders use a moving gradient to suggest activity. Animate background-position or transform for a smooth shimmer without layout shifts.

skeleton-shimmer
Live
untitled.html
HTML
1<div class="card-skel">
2 <div class="circle">
3 </div>
4 <div class="lines">
5 <div class="line">
6 </div>
7 <div class="line short">
8 </div>
9 </div>
10</div>
preview
Staggered List

When a list appears, stagger each item so the eye follows the sequence. Use CSS custom properties for delay values to keep the markup clean.

staggered-list
Live
untitled.html
HTML
1<button class="replay" id="replay">
2 Replay
3</button>
4<ul class="list">
5 <li style="--i:0">
6 Item one
7 </li>
8 <li style="--i:1">
9 Item two
10 </li>
11 <li style="--i:2">
12 Item three
13 </li>
14 <li style="--i:3">
15 Item four
16 </li>
17</ul>
preview
Easing Reference

Easing curves control the feel of motion. Use spring-like curves for playful UI and smooth deceleration for natural movement.

easing
Live
untitled.html
HTML
1<div class="track">
2 <div class="ball" data-ease="ease">
3 ease
4 </div>
5 <div class="ball" data-ease="ease-out">
6 ease-out
7 </div>
8 <div class="ball" data-ease="spring">
9 spring
10 </div>
11 <button id="run">
12 Run
13 </button>
14</div>
preview
Respect Reduced Motion

Always wrap motion in @media (prefers-reduced-motion: no-preference). Users with vestibular disorders or motion sensitivity need static alternatives.

untitled.css
CSS
1@media (prefers-reduced-motion: no-preference) {
2 .card {
3 transition: transform 0.3s ease, box-shadow 0.3s ease;
4 }
5 .card:hover {
6 transform: translateY(-6px);
7 box-shadow: 0 20px 40px rgba(0, 255, 65, 0.12);
8 }
9}
10
11@media (prefers-reduced-motion: reduce) {
12 .card {
13 transition: none;
14 }
15 .card:hover {
16 border-color: #00FF41;
17 }
18}
Performance Rules
  • Animate only transform and opacity for 60fps GPU compositing.
  • Avoid animating width, height, top, left, margin, or padding.
  • Use will-change sparingly and remove it after the animation ends.
  • Throttle scroll-linked animations with requestAnimationFrame.
  • Test on low-end devices and with reduced motion enabled.
Accessibility
  • Do not auto-play animations that cannot be paused.
  • Provide a visible focus indicator for keyboard users.
  • Use motion to reinforce state changes, not to convey information alone.
  • Respect prefers-reduced-motion for all non-essential motion.
  • Keep loading spinners below 2 seconds or show progress.

Community

Get help on Slack, Discord or VIP

Stuck on a guide? Join the community and ask.