animationsCreate performant web animations with proper accessibility and timing.
Install via ClawdBot CLI:
clawdbot install ivangdavila/animationsOnly these properties animate on the compositor thread (60fps):
| Property | Use |
|----------|-----|
| transform | Move, rotate, scale (translateX, rotate, scale) |
| opacity | Fade in/out |
Everything else triggers layout or paint. Avoid animating:
width, height, margin, padding (layout thrashing)top, left, right, bottom (use transform instead)border-width, font-size (expensive reflows)/* ❌ Triggers layout every frame */
.slide { left: 100px; transition: left 0.3s; }
/* ✅ GPU accelerated */
.slide { transform: translateX(100px); transition: transform 0.3s; }
~5% of users experience vestibular disorders (dizziness, nausea from motion).
/* Only animate if user hasn't requested reduced motion */
@media (prefers-reduced-motion: no-preference) {
.animated { animation: slide-in 0.5s ease-out; }
}
/* Or disable for those who requested it */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
Keep subtle fades and color changes even with reduced motion. Remove parallax, bouncing, infinite loops.
| Easing | Use case |
|--------|----------|
| ease-out | Elements entering view (appears responsive) |
| ease-in | Elements exiting view (accelerates away) |
| ease-in-out | Elements moving within view |
| linear | Only for spinners, progress bars, color cycling |
/* Custom bounce */
transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
/* Material Design standard */
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
| Type | Duration |
|------|----------|
| Micro-interactions (hover, focus) | 100-200ms |
| Transitions (modals, dropdowns) | 200-300ms |
| Page transitions | 300-500ms |
| Complex choreography | 500-1000ms max |
Anything over 500ms feels sluggish. Shorter is usually better.
Transitions: A to B state changes
.button { transform: scale(1); transition: transform 0.2s ease-out; }
.button:hover { transform: scale(1.05); }
Animations: Multi-step, auto-play, looping
@keyframes fadeSlideIn {
0% { opacity: 0; transform: translateY(20px); }
100% { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeSlideIn 0.5s ease-out forwards; }
Use transitions for hover/focus states. Use animations for on-load effects and sequences.
Only use as optimization when you have specific performance problems:
/* ✅ Apply before animation starts, remove after */
.card:hover { will-change: transform; }
.card { will-change: auto; }
/* ❌ Never apply globally */
* { will-change: transform, opacity; } /* Wastes GPU memory */
/* ❌ Animates everything including unintended properties */
.card { transition: all 0.3s; }
/* ✅ Only animates what you need */
.card { transition: transform 0.3s, box-shadow 0.3s; }
all can cause unexpected animations on color, background, border changes.
Exit animations require AnimatePresence:
/* ❌ Exit animation never plays */
{isVisible && <motion.div exit={{ opacity: 0 }} />}
/* ✅ Wrap conditional rendering */
<AnimatePresence>
{isVisible && <motion.div exit={{ opacity: 0 }} />}
</AnimatePresence>
Stable keys for list animations:
/* ❌ Index keys cause erratic animations */
{items.map((item, i) => <li key={i}>{item}</li>)}
/* ✅ Stable IDs */
{items.map(item => <li key={item.id}>{item.text}</li>)}
AutoAnimate parent must be unconditional:
/* ❌ Ref can't attach to conditional element */
{showList && <ul ref={parent}>...</ul>}
/* ✅ Parent always renders, children are conditional */
<ul ref={parent}>{showList && items.map(...)}</ul>
| Library | Size | Best for |
|---------|------|----------|
| CSS only | 0kb | Hover states, simple transitions |
| AutoAnimate | 3kb | Lists, accordions, toasts (90% of UI animations) |
| Motion | 22kb | Gestures, physics, scroll animations, complex choreography |
| GSAP | 60kb | Timelines, creative animation, scroll-triggered sequences |
Start with CSS. Add AutoAnimate for list animations. Only add Motion/GSAP for complex needs.
width/height instead of scale—causes layout thrashingtransition: all catching unintended propertiesGenerated Mar 1, 2026
An online retailer uses GPU-accelerated transforms and opacity for smooth image carousels and product card hover effects, ensuring 60fps performance. They implement reduced motion preferences to avoid discomfort for users with vestibular disorders, keeping subtle fades for accessibility. Timing functions like ease-out are applied for modal transitions during checkout, adhering to duration guidelines under 300ms for responsiveness.
A software-as-a-service platform employs CSS transitions for micro-interactions like button hovers and focus states, avoiding layout thrashing by animating transform instead of width/height. They use AutoAnimate for dynamic list updates in data tables, with stable keys to prevent erratic animations. Reduced motion support is included to disable parallax effects, ensuring usability for all users.
An educational application utilizes animations for on-load effects and page transitions, with durations of 300-500ms for smooth user guidance. They apply ease-in-out for elements moving within view and ensure exit animations work properly with AnimatePresence in React frameworks. Library selection starts with CSS for basic transitions, adding Motion only for complex scroll-triggered sequences.
A news portal implements fade and slide animations for article loading, using GPU-accelerated properties to maintain performance during high traffic. They avoid common mistakes like infinite loops and instead use controlled animations with specific transition properties. Reduced motion media queries disable bouncing effects while preserving essential color changes for readability.
A healthcare platform uses animations to highlight changes in charts and graphs, with linear easing for progress bars and spinners. They prioritize accessibility by adhering to reduced motion preferences and avoiding durations over 500ms to prevent sluggishness. Integration tips include using will-change sparingly for optimization only when specific performance issues arise.
Freelancers offer animation optimization services to clients, focusing on performance and accessibility to enhance user experience. They charge per project or hourly, with revenue generated from website redesigns and speed improvements. This model leverages the skill's guidelines to reduce bounce rates and increase client satisfaction.
A subscription-based platform provides animation libraries and tools for developers, with tiers based on features like AutoAnimate or Motion integration. Revenue comes from monthly or annual subscriptions, targeting businesses needing scalable animation solutions. The model emphasizes ease of use and compliance with accessibility standards to attract diverse users.
Digital agencies consult on animation best practices for large-scale projects, offering audits and implementation to improve site performance. Revenue is generated through retainer contracts or one-time consulting fees, focusing on industries like e-commerce and media. This model helps clients avoid common mistakes and integrate animations efficiently.
💬 Integration Tip
Start with CSS animations for basic effects and progressively enhance with libraries like AutoAnimate for dynamic content, ensuring to test reduced motion preferences across devices.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Expert frontend design guidelines for creating beautiful, modern UIs. Use when building landing pages, dashboards, or any user interface.
Use when building UI with shadcn/ui components, Tailwind CSS layouts, form patterns with react-hook-form and zod, theming, dark mode, sidebar layouts, mobile navigation, or any shadcn component question.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when building web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Create distinctive, production-grade static sites with React, Tailwind CSS, and shadcn/ui — no mockups needed. Generates bold, memorable designs from plain text requirements with anti-AI-slop aesthetics, mobile-first responsive patterns, and single-file bundling. Use when building landing pages, marketing sites, portfolios, dashboards, or any static web UI. Supports both Vite (pure static) and Next.js (Vercel deploy) workflows.
AI skill for automated UI audits. Evaluate interfaces against proven UX principles for visual hierarchy, accessibility, cognitive load, navigation, and more. Based on Making UX Decisions by Tommy Geoco.