ui-animation
Original:🇺🇸 English
Translated
Guidelines and examples for UI motion and animation. Use when designing, implementing, or reviewing motion, easing, timing, reduced-motion behaviour, CSS transitions, keyframes, framer-motion, or spring animations.
19installs
Sourcemblode/agent-skills
Added on
NPX Install
npx skill4agent add mblode/agent-skills ui-animationTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →UI Animation
Core rules
- Animate to clarify cause/effect or add deliberate delight.
- Keep interactions fast (200-300ms; up to 1s only for illustrative motion).
- Never animate keyboard interactions (arrow-key navigation, shortcut responses, tab/focus).
- Prefer CSS; use WAAPI or JS only when needed.
- Make animations interruptible and input-driven.
- Honor (reduce or disable).
prefers-reduced-motion
What to animate
- For movement and spatial change, animate only and
transform.opacity - For simple state feedback, ,
color, andbackground-colortransitions are acceptable.opacity - Never animate layout properties; never use .
transition: all - Avoid animation for core interactions; if unavoidable, keep blur <= 20px.
filter - SVG: apply transforms on a wrapper with
<g>.transform-box: fill-box; transform-origin: center - Disable transitions during theme switches.
Spatial and sequencing
- Set at the trigger point.
transform-origin - For dialogs/menus, start around ; avoid
scale(0.85-0.9).scale(0) - Stagger reveals <= 50ms.
Easing defaults
- Enter and transform-based hover: .
cubic-bezier(0.22, 1, 0.36, 1) - Move: .
cubic-bezier(0.25, 1, 0.5, 1) - Simple hover colour/background/opacity: .
200ms ease - Avoid for UI (feels slow).
ease-in
Accessibility
- If is used, disable it in
transform.prefers-reduced-motion - Disable hover transitions on touch devices via .
@media (hover: hover) and (pointer: fine)
Performance
- Pause looping animations off-screen.
- Toggle only during heavy motion and only for
will-change/transform.opacity - Prefer over positional props in animation libraries.
transform - Do not animate drag gestures using CSS variables.
Reference
- Snippets and practical tips: examples.md
Workflow
- Start with the core rules, then pick a reference snippet from examples.md.
- Keep motion functional; honor .
prefers-reduced-motion - When reviewing, cite file paths and line numbers and propose concrete fixes.