motion
Skill2 starsChanged 29 days agoApache-2.0View on GitHub
Animate React/Next.js UI with the `motion` package (Framer Motion's successor): entrances, stagger, hover/tap feedback, layout and shared-element transitions, AnimatePresence, scroll-linked effects, reduced-motion. Use when adding or fixing animations, transitions or micro-interactions.
- Installs packages
38 other projects use a version of this.
Adopted by
Most recently taken up by
- sanmidable/skillstheir own version, first seen Nov 8, 2026
- podo/design-agent-skillstheir own version, first seen Nov 8, 2026
- RuneStone-Tech/optimize-anythingtheir own version, first seen Nov 8, 2026
- lalulali/vespyrtheir own version, first seen Nov 6, 2026
- theexperiencecompany/gaiatheir own version, first seen Nov 3, 2026
- seanx10m/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use defaults, viewports and 8 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 3 projects that use this
sanmidableSkillviewports
Also in 3 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 3 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
owshq-mecSkilllayout
Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.
Also in 3 projects that use this
HK-hubSkillpolish
Performs a final quality pass fixing alignment, spacing, consistency, and micro-detail issues before shipping. Use when the user mentions polish, finishing touches, pre-launch review, something looks off, or wants to go from good to great.
Also in 3 projects that use this
Other versions38 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 38
- theexperiencecompany/gaia★ 325same name
- Mindrally/skills★ 275same name
- raphaelsalaja/skills★ 62same name
- podo/design-agent-skills★ 32same name
- muzimu217/ui-design-agent-kit★ 23same name
- imMamdouhaboammar/linkedin-animated-infographics★ 14same name
- icons8/agent-skills★ 12same name
- lalulali/vespyr★ 11same name
- sukirman1901/frontend-expert★ 9same name
- app-builders-club/design-builder★ 4same name
28 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.
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 5 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 32 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Use the durations and easings already in the tokens (--dur-*, --ease-*) before the defaults below.
- Very specific: line 23
Use the Motion AI Kit when present: If the official /motion skill exists (<root>/.claude/skills/motion or ~/.claude/skills/motion) or the …
- Distinctive: line 42
Before using an API not listed here, check https://motion.dev/docs with WebFetch (or the Motion MCP).
- Very specific: line 156
Do not animate hundreds of nodes individually.
- Distinctive: line 162
Use it only on elements that are fine being hidden briefly, never on the main heading/CTA without a short duration.
- Distinctive: line 169
Test with CPU throttling 4× and on a real phone.
- Distinctive: line 174
Every interactive element gives feedback within 150 ms on hover and tap.
- Distinctive: line 175
No animation blocks reading or clicking.
- Very specific: line 182
When a choreography is settled (what moves, durations, easings), write it to .hyperui/design.md (motion section), the next step to …
- Very specific: line 189
Verify API names before use.
“Common” is measured: kept by at least 6 in 10 of the 32 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 for React / Next.js
0. Before anything
- Resolve the project root with
${CLAUDE_PLUGIN_ROOT}/scripts/profile.sh rootand use it (absolute paths) for.hyperui/and for every repo read/write. If<root>/.hyperui/profile.mdis missing, invoke thehyperuiskill first (it onboards and routes); otherwise readprofile.mdandstate.mdand never re-ask what they hold. With several roots (profile.sh roots), work in the repo the request or the touched file belongs to, with that repo's.hyperui/(rules:${CLAUDE_PLUGIN_ROOT}/references/workspace.md). Profile fields used: archetype,conversation_language,design.*,tone_notes; also.hyperui/design.md. design.motionsets the register:restrained→ only the hero sequence and micro-feedback;expressive→ add scroll reveals and shared-element transitions. Unset →restrained.prefers-reduced-motionis honored by default (recipe H) — never ask whether to.- Use the durations and easings already in the tokens (
--dur-*,--ease-*) before the defaults below. - Reply in the conversation language; keep internal reasoning, code and files in English.
- Tone per archetype: non-tech → one or two plain sentences per step; dev → the fact + one line of why; senior → the fact.
Use the Motion AI Kit when present. If the official /motion skill exists (<root>/.claude/skills/motion or
~/.claude/skills/motion) or the motion MCP is connected, use it for docs and example search, CSS springs and
MotionScore audits (springs and audits need Motion+). This skill stays the taste and choreography layer: the language,
recipes and QA below decide what moves and why. If neither is present, say once that /hyperui:setup installs it.
1. Install and import
npm install motion"use client"; // required in Next.js App Router for any file that uses motion components/hooks
import { motion, AnimatePresence, MotionConfig, useReducedMotion, useScroll, useTransform, useInView } from "motion/react";motion/reactis the current import path. The legacyframer-motionpackage still works and exposes the same API; prefermotion/reactin new code and do not mix both in one project.- Vanilla / non-React code:
import { animate, scroll, inView, stagger } from "motion". stagger()from"motion"is the standalone helper; inside React variants usetransition: { staggerChildren }(see recipe A).- Before using an API not listed here, check https://motion.dev/docs with WebFetch (or the Motion MCP). Do not guess prop names.
2. Motion language
- Durations: 150–250 ms for micro-feedback (hover, press, toggle), 300–500 ms for entrances, ≤ 800 ms for a hero sequence. Nothing a user waits for takes longer than 500 ms.
- Easing: ease-out (
[0.16, 1, 0.3, 1]) for things entering, ease-in-out for things moving between places, springs for things the user touches (stiffness300–500,damping25–35). - Properties: animate
transform(x, y, scale, rotate) andopacityonly;clip-pathandfiltersparingly. Never animate width/height/top/left directly — use thelayoutprop. - Distances: entrances travel 8–24 px. Scale from 0.96–0.98, never from 0.
- Stagger: 40–80 ms between siblings; cap the visible staggered set at ~8 items.
- One choreography per view. The hero gets a sequence; everything below gets at most a quiet reveal. If everything moves, nothing does.
- Reason, in priority order: orientation (where did this come from) → feedback (did my action register) → continuity (same object, new place) → delight. No reason, no animation.
- Reduced motion is not optional:
useReducedMotion()→ drop transforms, keep opacity fades, shorten durations. Wire it once at the root withMotionConfig(recipe H).
3. Recipes
A. Variants + stagger for a hero or list
const list = { hidden: {}, show: { transition: { staggerChildren: 0.06, delayChildren: 0.1 } } };
const item = { hidden: { opacity: 0, y: 16 }, show: { opacity: 1, y: 0, transition: { duration: 0.4, ease: [0.16, 1, 0.3, 1] } } };
<motion.ul variants={list} initial="hidden" animate="show">
{items.map((it) => <motion.li key={it.id} variants={item}>{it.label}</motion.li>)}
</motion.ul>B. Button with spring feedback
<motion.button
whileHover={{ scale: 1.02, y: -1 }}
whileTap={{ scale: 0.97 }}
transition={{ type: "spring", stiffness: 400, damping: 28 }}
>
Download
</motion.button>C. AnimatePresence for swapped content (modal, step, tab panel)
<AnimatePresence mode="wait" initial={false}>
<motion.div
key={step} // a stable, unique key per state is mandatory
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -8 }}
transition={{ duration: 0.2 }}
>
{content[step]}
</motion.div>
</AnimatePresence>D. Shared-element tab indicator
{tabs.map((t) => (
<button key={t} onClick={() => setActive(t)} style={{ position: "relative" }}>
{t}
{active === t && (
<motion.span layoutId="tab-indicator" style={{ position: "absolute", inset: "auto 0 0 0", height: 2, background: "var(--accent)" }}
transition={{ type: "spring", stiffness: 500, damping: 35 }} />
)}
</button>
))}E. Scroll reveal (once, slightly before fully in view)
<motion.section
initial={{ opacity: 0, y: 24 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: "-10%" }}
transition={{ duration: 0.5, ease: [0.16, 1, 0.3, 1] }}
/>F. Scroll-linked progress bar and parallax
const { scrollYProgress } = useScroll(); // page progress 0..1
<motion.div style={{ scaleX: scrollYProgress, transformOrigin: "0 0", height: 2, background: "var(--accent)", position: "fixed", top: 0, left: 0, right: 0 }} />
const ref = useRef(null);
const { scrollYProgress: p } = useScroll({ target: ref, offset: ["start end", "end start"] });
const y = useTransform(p, [0, 1], [-40, 40]); // parallax drift in px
<motion.img ref={ref} style={{ y }} src="/hero.png" alt="" />G. Reduced-motion-safe variants
export function useMotionSafe() {
const reduce = useReducedMotion();
const item = reduce
? { hidden: { opacity: 0 }, show: { opacity: 1, transition: { duration: 0.2 } } }
: { hidden: { opacity: 0, y: 16 }, show: { opacity: 1, y: 0, transition: { duration: 0.4, ease: [0.16, 1, 0.3, 1] } } };
const list = { hidden: {}, show: { transition: { staggerChildren: reduce ? 0 : 0.06 } } };
return { item, list, reduce };
}H. Root config (do this once, in the app layout's client provider)
<MotionConfig reducedMotion="user" transition={{ duration: 0.25, ease: [0.16, 1, 0.3, 1] }}>
{children}
</MotionConfig>reducedMotion="user" makes Motion skip transform/layout animations automatically when the OS setting is on; recipe G is for cases where you want explicit control of the fallback.
4. Performance and pitfalls
- Let Motion manage
will-change; do not sprinkle it in CSS — it costs memory on every element. - Do not animate hundreds of nodes individually; animate the container, or virtualize and only
animate what is visible (
whileInView). - Hydration flicker on mount: pass
initial={false}toAnimatePresenceor to the component so the first paint is the final state. - SSR:
motion.*components render their static markup on the server; theinitialstate is applied as inline style, so a hiddeninitialmeans the element is invisible until JS runs. Use it only on elements that are fine being hidden briefly, never on the main heading/CTA without a short duration. AnimatePresenceneeds stable, uniquekeys on direct children; without them exit animations never run.layoutanimations inside scroll containers: mark the scroller withlayoutScroll; for independent layout groups useLayoutGroup(verify on motion.dev).- Images and video inside
layoutelements distort during the transition; putlayouton a wrapper and keep the medialayout="position". - Test with CPU throttling 4× and on a real phone; if anything drops frames, remove the animation rather than tuning it for an hour.
5. QA checklist
- OS "Reduce motion" on → no transforms, only short fades; nothing becomes unreachable.
- Every interactive element gives feedback within 150 ms on hover and tap.
- No animation blocks reading or clicking; no entrance runs longer than 500 ms except the hero.
- 60 fps at 4× CPU throttle on the heaviest page; no layout thrash in the Performance panel.
AnimatePresenceexits actually play (keys are stable), and nothing flickers on first paint.- Seen in a browser, with evidence (
${CLAUDE_PLUGIN_ROOT}/skills/design/references/browser-verify.md): capture the choreography (a short GIF with Claude in Chrome when available) AND the reduced-motion path at 360 and 1280, recorded under## Browser evidenceindesign.md; no browser tool → say so, never "feels smooth".
6. Close the turn
When a choreography is settled (what moves, durations, easings), write it to .hyperui/design.md (motion section),
the next step to state.md, and one ADR-lite line to decisions.md (date · decision · why · source).
Sources
Cite only URLs that are listed in a skill/reference or that you opened this session; never construct or guess a URL.
Verify API names before use. Canonical references: references/sources.md.
Motion AI Kit (skill + MCP, free vs Motion+): https://motion.dev/docs/ai-kit · install: https://motion.dev/docs/ai-kit-install
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.

