Motion Grid Notes
MIT-licensed animation library for React and JavaScript (formerly Framer Motion), offering a 3.3 kB `motion/mini` WAAPI build as well as layout, gesture and spring animations.
Install and prerequisites
npm install motionmotionIn React 18/19, import from motion/react (or motion/mini for tiny WAAPI animations), never from the legacy framer-motion package.
Framework setup
Lightweight WAAPI animations with motion/mini (3.3 kB)
Use animate from motion/mini when you only need hardware-accelerated opacity or transform transitions without pulling in the 33 kB full runtime.
"use client";
import { useEffect, useRef } from "react";
import { animate } from "motion/mini";
export function FadeIn({ children }: { children: React.ReactNode }) {
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
if (!ref.current) return;
const controls = animate(
ref.current,
{ opacity: [0, 1], transform: ["translateY(4px)", "translateY(0px)"] },
{ duration: 0.2, easing: [0.22, 1, 0.36, 1] },
);
return () => controls.cancel();
}, []);
return <div ref={ref}>{children}</div>;
}Tree-shaken React components with LazyMotion + m
When you need AnimatePresence, variants or gestures, pair LazyMotion (strict) with m from motion/react-m and MotionConfig reducedMotion="user".
"use client";
import { LazyMotion, MotionConfig, domAnimation } from "motion/react";
import * as m from "motion/react-m";
export function MotionProvider({ children }: { children: React.ReactNode }) {
return (
<LazyMotion features={domAnimation} strict>
<MotionConfig reducedMotion="user">{children}</MotionConfig>
</LazyMotion>
);
}
export function Card({ children }: { children: React.ReactNode }) {
return <m.div initial={{ opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }}>{children}</m.div>;
}Gotchas for agents
Pass both keyframes to motion/mini animate()
motion/miniruns on the Web Animations API. Passing a single target value like{ opacity: 0 }forces a synchronousgetComputedStyle()read on the main thread; pass explicit[from, to]arrays ({ opacity: [1, 0] }) when the starting state is known.motion/mini uses transform strings, not shorthand props
Unlike full
<motion.div y={8}>,motion/mini'sanimate()expects standard CSS properties such astransform: ["translateY(8px)", "translateY(0px)"].Physics spring options override duration and bounce
In Motion's spring generator (
type: "spring"), specifyingstiffness,dampingormassoverridesdurationandbounce. Default physics values arestiffness: 100, damping: 10, mass: 1(damping ratiodamping / (2 * Math.sqrt(stiffness * mass))).Bundle cost of full motion vs LazyMotion vs mini
motion/miniis3.3 kBgzip;LazyMotion+domAnimationis about32.9 kBgzip (domMaxadds layout and drag). Never import the fullmotionobject frommotion/reactwhenLazyMotion strictis used.
Accessibility and reduced motion
Reduced motion
Wrap full Motion trees in <MotionConfig reducedMotion="user">: Motion disables transform and layout animations while preserving opacity and colour transitions. For motion/mini, check window.matchMedia('(prefers-reduced-motion: reduce)').matches and omit transform keyframes.
Keyboard and screen readers
When animating tab panels or step swaps, avoid holding the incoming panel behind an AnimatePresence mode="wait" exit delay if focus needs to move to the new heading immediately.
More Grid Notes
- LenisLightweight smooth-scroll engine that keeps native browser scrolling, sticky positioning and intersection observers intact, and pairs cleanly with GSAP ScrollTrigger.
- GSAPTimeline, scroll-linked and text-splitting animation engine. All plugins — including ScrollTrigger, SplitText and MorphSVG — are included under Webflow's no-charge licence.
- dotLottieLottieFiles' WebAssembly-powered player for `.lottie` archives and Lottie JSON animations, with official wrappers for React, Vue, Svelte and plain web canvas.
- NumberFlowDependency-free animated number component for React, Vue and Svelte that rolls individual digits into place and formats values with `Intl.NumberFormat`.
- RiveInteractive state-machine graphics packaged in compact `.riv` files and driven at 60–120 fps by Rive's open-source WebGL2 and Canvas runtimes.
- Theatre.jsKeyframe timeline engine and visual studio overlay for choreographing Three.js / React Three Fiber cameras, lights and DOM properties.



