motion
Skill275 starsChanged 52 days agoApache-2.0View on GitHub
Expert guidelines for building performant animations with Motion (formerly Motion One) vanilla JavaScript animation library
- Installs packages
45 other projects use a version of this.
Adopted by
Most recently taken up by
- johnjoners/skillstheir own version, first seen Nov 29, 2026
- officialunofficial/skillstheir own version, first seen Nov 29, 2026
- marcioaltoe/skillstheir own version, first seen Nov 29, 2026
- DobroslavRadosavljevic/cabrakantheir own version, first seen Nov 29, 2026
- Thoven-CORP/agent-skillstheir own version, first seen Nov 29, 2026
- alexcollins/skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use defaults, viewports and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
sanmidableSkilldefaults
Also in 4 projects that use this
sanmidableSkillviewports
Also in 4 projects that use this
miovragSkillkeyboard
Load this skill for every project containing interactive UI elements — buttons, links, modals, dropdowns, sliders, tabs, carousels, or any custom widget. Under no circumstances create an interactive component that cannot be fully operated by keyboard alone. Absolutely always ensure visible focus indicators, logical tab order, and no keyboard traps. Apply these rules to every interactive element without exception.
Also in 4 projects that use this
soilmassSkillcolor
Color animations including hue shifts, saturation changes, brightness transitions, and contrast adjustments. Use when implementing color morphing, theme transitions, mood effects, or attention-grabbing color pulses. Provides tokens for all color property animations.
Also in 4 projects that use this
baizhine999Skillalignment
拉通对齐会模式。AI 扮演你的 Leader,模拟跨团队对齐会前的准备辅导和会中压力:push 你厘清诉求、预判各方立场、准备让步底线、处理拉锯博弈。触发词:/alignment, 拉通, 对齐会, 跨团队, 要开会了, 他们不配合, 有分歧, 需要协调。AI 是裁判和施压者,你是被考验的那个人。
Also in 3 projects that use this
JasonPaffSkilltanstack-table
Build headless data tables with TanStack Table v8. Server-side pagination, filtering, sorting, and virtualization for Cloudflare Workers + D1. Prevents 12 documented errors.
Also in 3 projects that use this
- +4 more from sanmidable
Other versions45 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 45
- theexperiencecompany/gaia★ 336same name
- raphaelsalaja/skills★ 72same name
- podo/design-agent-skills★ 39same name
- JustCarlos30/skills-videos-cortos★ 35same name
- muzimu217/ui-design-agent-kit★ 23same name
- icons8/agent-skills★ 14same name
- imMamdouhaboammar/linkedin-animated-infographics★ 14same name
- lalulali/vespyr★ 11same name
- sukirman1901/frontend-expert★ 9same name
- officialunofficial/skills★ 7same name
35 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 9 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 38 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Use motion for vanilla JavaScript/TypeScript projects
- Very specific: line 18
Use motion/react for React projects (see framer-motion skill)
- Very specific: line 101
Prefer x, y over left, top
- Very specific: line 102
Prefer scale over width, height
- Very specific: line 103
Use opacity for fade effects
- Very specific: line 104
Use rotate over transform: rotate()
- Distinctive: line 404
Use transform properties (x, y, scale, rotate) for best performance
- Distinctive: line 405
Add will-change before complex animations, remove after
- Distinctive: line 406
Use timeline for sequenced animations
- Distinctive: line 407
Use scroll() for scroll-linked effects
- Distinctive: line 408
Use inView() for viewport-triggered animations
- Distinctive: line 409
Use stagger() for animating multiple elements
- Distinctive: line 410
Prefer springs for interactive/gesture animations
- Distinctive: line 411
Always respect reduced motion preferences
- Distinctive: line 413
Test performance on actual devices
“Common” is measured: kept by at least 6 in 10 of the 38 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Motion Animation Guidelines
You are an expert in Motion (motion.dev), JavaScript, TypeScript, and web animation performance. Follow these guidelines when creating animations.
Core Principles
About Motion
- Motion is the JavaScript animation library from the creator of Framer Motion
- Use
motionfor vanilla JavaScript/TypeScript projects - Use
motion/reactfor React projects (see framer-motion skill) - Designed for high performance with minimal bundle size
Installation
npm install motionBasic Import
import { animate, scroll, inView, timeline } from "motion";Basic Animations
Simple Animation
import { animate } from "motion";
// Animate a single element
animate(".element", { x: 100, opacity: 1 }, { duration: 0.5 });
// Animate with options
animate(
".element",
{ transform: "translateX(100px)" },
{
duration: 0.8,
easing: "ease-out"
}
);Keyframes
animate(
".element",
{
x: [0, 100, 50], // Keyframe values
opacity: [0, 1, 0.5]
},
{ duration: 1 }
);Performance Optimization
Animate Transform Properties
// Best performance - GPU accelerated
animate(".element", {
x: 100, // translateX
y: 50, // translateY
scale: 1.2, // scale
rotate: 45, // rotate
opacity: 0.5 // opacity
});
// Avoid when possible - triggers layout
animate(".element", {
width: 200, // Causes layout recalculation
height: 150, // Causes layout recalculation
top: 50, // Causes layout recalculation
left: 100 // Causes layout recalculation
});Use will-change
// Add will-change for transform animations
const element = document.querySelector(".element");
element.style.willChange = "transform";
animate(element, { x: 100 }, {
onComplete: () => {
element.style.willChange = "auto"; // Remove after animation
}
});Hardware Acceleration
Motion automatically uses hardware-accelerated properties when possible. For best performance:
- Prefer
x,yoverleft,top - Prefer
scaleoverwidth,height - Use
opacityfor fade effects - Use
rotateovertransform: rotate()
Timeline Animations
Create Timelines
import { timeline } from "motion";
const sequence = [
[".header", { y: ["-100%", 0], opacity: [0, 1] }],
[".content", { y: [50, 0], opacity: [0, 1] }, { at: "-0.3" }],
[".footer", { y: [50, 0], opacity: [0, 1] }, { at: "-0.3" }]
];
const controls = timeline(sequence, {
duration: 0.8,
defaultOptions: { easing: "ease-out" }
});Timeline Controls
const controls = timeline(sequence);
controls.play();
controls.pause();
controls.reverse();
controls.stop();
controls.finish();
// Seek to specific time
controls.currentTime = 0.5;Scroll Animations
Basic Scroll Animation
import { scroll, animate } from "motion";
scroll(
animate(".progress-bar", { scaleX: [0, 1] }),
{ target: document.querySelector("article") }
);Scroll-Linked Animation
scroll(({ y }) => {
// y.progress is 0 to 1
animate(".element", {
opacity: y.progress,
y: y.progress * 100
}, { duration: 0 });
});Scroll with Container
scroll(
animate(".parallax", { y: [0, -100] }),
{
target: document.querySelector(".section"),
offset: ["start end", "end start"]
}
);In-View Animations
Trigger on Visibility
import { inView, animate } from "motion";
inView(".card", (info) => {
animate(info.target, { opacity: 1, y: 0 }, { duration: 0.5 });
// Return cleanup function
return () => {
animate(info.target, { opacity: 0, y: 20 }, { duration: 0.2 });
};
});With Options
inView(
".element",
(info) => {
animate(info.target, { scale: [0.8, 1], opacity: [0, 1] });
},
{
margin: "-100px", // Trigger 100px before entering viewport
amount: 0.5 // Trigger when 50% visible
}
);Stagger Animations
Stagger Multiple Elements
import { stagger, animate } from "motion";
animate(
".list-item",
{ opacity: [0, 1], y: [20, 0] },
{ delay: stagger(0.1) }
);Stagger from Center
animate(
".grid-item",
{ scale: [0, 1] },
{ delay: stagger(0.05, { from: "center" }) }
);Stagger with Easing
animate(
".item",
{ x: ["-100%", 0] },
{
delay: stagger(0.1, {
easing: "ease-out",
start: 0.2
})
}
);Spring Animations
Use Springs for Natural Motion
animate(
".element",
{ scale: 1.2 },
{
easing: "spring",
// or with custom spring settings
easing: [0.34, 1.56, 0.64, 1] // Custom bezier curve
}
);Spring Options
animate(".element", { x: 100 }, {
type: "spring",
stiffness: 300,
damping: 30
});Easing Functions
Built-in Easings
// Common easing values
animate(".element", { x: 100 }, { easing: "ease" });
animate(".element", { x: 100 }, { easing: "ease-in" });
animate(".element", { x: 100 }, { easing: "ease-out" });
animate(".element", { x: 100 }, { easing: "ease-in-out" });
animate(".element", { x: 100 }, { easing: "linear" });
// Cubic bezier
animate(".element", { x: 100 }, {
easing: [0.25, 0.1, 0.25, 1]
});Animation Controls
Control Playback
const controls = animate(".element", { x: 100 }, { duration: 1 });
// Control methods
controls.play();
controls.pause();
controls.stop();
controls.finish();
controls.reverse();
// Get/set time
controls.currentTime = 0.5;
console.log(controls.duration);
// Cancel animation
controls.cancel();Animation Events
const controls = animate(
".element",
{ x: 100 },
{
duration: 1,
onComplete: () => console.log("Done!")
}
);
// Promise-based
controls.finished.then(() => {
console.log("Animation finished");
});Accessibility
Respect Reduced Motion
const prefersReducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
animate(
".element",
{ x: 100, opacity: 1 },
{
duration: prefersReducedMotion ? 0 : 0.5,
easing: prefersReducedMotion ? "linear" : "ease-out"
}
);Create Accessible Wrapper
function safeAnimate(element, keyframes, options = {}) {
const reducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
return animate(element, keyframes, {
...options,
duration: reducedMotion ? 0 : (options.duration ?? 0.3)
});
}Integration with Frameworks
Vanilla JavaScript
document.addEventListener("DOMContentLoaded", () => {
animate(".hero", { opacity: [0, 1], y: [30, 0] });
});With Event Listeners
const button = document.querySelector(".button");
button.addEventListener("mouseenter", () => {
animate(button, { scale: 1.05 }, { duration: 0.2 });
});
button.addEventListener("mouseleave", () => {
animate(button, { scale: 1 }, { duration: 0.2 });
});Cleanup
Cancel Animations
const controls = animate(".element", { x: 100 });
// Later, cancel it
controls.cancel();Cleanup Pattern
class AnimatedComponent {
constructor(element) {
this.element = element;
this.animations = [];
}
animate(keyframes, options) {
const controls = animate(this.element, keyframes, options);
this.animations.push(controls);
return controls;
}
destroy() {
this.animations.forEach(anim => anim.cancel());
this.animations = [];
}
}Best Practices Summary
- Use transform properties (x, y, scale, rotate) for best performance
- Add will-change before complex animations, remove after
- Use timeline for sequenced animations
- Use scroll() for scroll-linked effects
- Use inView() for viewport-triggered animations
- Use stagger() for animating multiple elements
- Prefer springs for interactive/gesture animations
- Always respect reduced motion preferences
- Cancel animations when no longer needed
- Test performance on actual devices
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

