
Motion Ui
Implement React or Next.js UI motion that guides attention and state without hurting accessibility or performance.
Overview
Motion UI is an agent skill for the Build phase that implements production-ready React/Next.js animations with accessibility and performance guardrails.
Install
npx skills add https://github.com/affaan-m/everything-claude-code --skill motion-uiWhat is this skill?
- Motion System v4.2 focused on performance, accessibility, and usability—not decoration
- Install via npm package motion with motion/react as default; do not mix with framer-motion import paths
- Requires reduced-motion support and low-end device adaptation
- Use when motion guides attention, communicates state, or preserves spatial continuity
- Explicit anti-patterns: skip purely decorative or clarity-reducing motion
- Default import path: motion/react (package motion)
Adoption & trust: 1.2k installs on skills.sh; 210k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want polished UI motion but agents keep adding decorative animations that hurt clarity, a11y, or performance.
Who is it for?
Next.js or React SaaS builders adding stateful transitions, modals, and navigation motion with ECC-origin conventions.
Skip if: Pure CSS marketing sites with no React motion stack, or projects that must stay on legacy framer-motion without migration planning.
When should I use this skill?
Implementing animations, transitions, or motion patterns in React/Next.js when motion guides attention, state, or spatial continuity.
What do I get? / Deliverables
You get consistent Motion for React patterns with reduced-motion and device-aware defaults across interactive UI.
- Motion-aligned component transitions
- Accessibility-compliant animation defaults
Recommended Skills
Journey fit
How it compares
Opinionated motion design system for agents—not a drop-in component library like a headless UI kit.
Common Questions / FAQ
Who is motion-ui for?
Solo builders and small teams shipping React or Next.js interfaces who want agent help implementing animations without accessibility or performance regressions.
When should I use motion-ui?
Use during Build frontend when adding transitions for loading, success, errors, modals, menus, or layout continuity—not for decoration-only effects.
Is motion-ui safe to install?
Check the Security Audits panel on this Prism page; the skill is documentation-heavy but may guide npm installs you should verify in your lockfile.
SKILL.md
READMESKILL.md - Motion Ui
# Motion System v4.2 Production-ready UI motion system for React / Next.js. Focused on **performance, accessibility, and usability** — not decoration. ## When to Use Use this motion system when motion: * Guides attention (e.g., onboarding, key actions) * Communicates state (loading, success, error, transitions) * Preserves spatial continuity (layout changes, navigation) ### Appropriate Scenarios * Interactive components (buttons, modals, menus) * State transitions (loading → loaded, open → closed) * Navigation and layout continuity (shared elements, crossfade) ### Considerations * **Accessibility**: Always support reduced motion * **Device adaptation**: Adjust for low-end devices * **Performance trade-offs**: Prefer responsiveness over visual smoothness ### Avoid Using Motion When * It is purely decorative * It reduces usability or clarity * It impacts performance negatively --- ## How It Works ### Core Principle Motion must: * Guide attention * Communicate state * Preserve spatial continuity If it does none → remove it. --- ### Installation ```bash npm install motion ``` --- ### Version * `motion/react` - default for current Motion for React projects (package: `motion`) * `framer-motion` - legacy import path for projects that still depend on Framer Motion **Do not mix.** Mixing causes conflicting internal schedulers and broken `AnimatePresence` contexts — components from one package will not coordinate exit animations with components from the other. To check which version your project uses: ```bash cat package.json | grep -E '"motion"|"framer-motion"' ``` Always import from one source consistently: ```ts // Correct (modern) import { motion, AnimatePresence } from "motion/react" // Correct (legacy) import { motion, AnimatePresence } from "framer-motion" // Never mix both in the same project ``` --- ### Motion Tokens ```ts // motionTokens.ts export const motionTokens = { duration: { fast: 0.18, normal: 0.35, slow: 0.6 }, // Use these as the `ease` value inside a `transition` object: // transition={{ duration: motionTokens.duration.normal, ease: motionTokens.easing.smooth }} easing: { smooth: [0.22, 1, 0.36, 1] as [number, number, number, number], sharp: [0.4, 0, 0.2, 1] as [number, number, number, number] }, distance: { sm: 8, md: 16, lg: 24 } } ``` Usage example: ```tsx import { motionTokens } from "@/lib/motionTokens" <motion.div initial={{ opacity: 0, y: motionTokens.distance.md }} animate={{ opacity: 1, y: 0 }} transition={{ duration: motionTokens.duration.normal, ease: motionTokens.easing.smooth }} /> ``` --- ### Performance Rules **Safe** * transform * opacity **Avoid** * width / height * top / left Rule: responsiveness > smoothness --- ### Device Adaptation The heuristic combines CPU core count **and** available memory for a more reliable signal. `deviceMemory` is available on Chrome/Android; the fallback covers Safari and Firefox. ```ts const isLowEnd = typeof navigator !== "undefined" && ( // Low memory (Chrome/Android only; undefined elsewhere → treat as capable) (navigator.deviceMemory !== undefined && navigator.deviceMemory <= 2) || // Few cores AND no memory API (covers Safari/Firefox on weak hardware) (navigator.deviceMemory === undefined && navigator.hardwareConcurrency <= 4) ) const duration = isLowEnd ? 0.2 : 0.4 ``` --- ### Accessibility #### JS (useReducedMotion) ```tsx import { motion, useReducedMotion } from "motion/react" export function FadeIn() { const reduce = useReducedMotion() return ( <motion.div initial={{ opacity: 0, y: reduce ? 0 : 24 }} animate={{ opacity: 1, y: 0 }} /> ) } ``` #### CSS ```css @media (prefers-reduced-motion: reduce) { .motion-safe-transition {