Hello, here's a brain dump of everything I know about animation performance. Animating layout isn't always bad. Global CSS variables are a performance killer. Hardware accelerated blurs can crash sites. Surprised? Those and more in this post: motion.dev/blog/web-ani...
Matt Perry
Matt Perry
@citizenofnowhe.re
π΅ Creator of motion.dev π· Photographer citizenofnowhe.re
6.4K followers57 following306 posts
π We've launched a brand new tutorials hub! Tutorials were buried in the examples microsite, now they're all in one easy-to-browse redesigned space. And each example has received a massive facelift. Check it out: motion.dev/tutorials
Matt Perry reposted
If you thought we were done with View Transitions, guess again! A feature Chrome is working on, is βScoped View Transitionsβ, which allow you to scope a VT to a subtree of the DOM. This unlocks things like concurrent transitions and prevents layering issues. developer.chrome.com/blog/scoped-...
Super excited to welcome @sanity.io as the newest Motion sponsor! Sanity have been longtime users of Motion and it's amazing they're helping support its future as a platinum sponsor. Check them out: sanity.io
Anyway this is a long way of saying: π’ Carousel is the next component coming to Motion+ - target mid-September release. π Also, Motion+ has reached 1000 users! This is a mind-blowing and humbling milestone, thanks for all the support! Join Motion+ motion.dev/plus
Carousels rarely fulfil both of these rules. The ones that do are all on @framer.com - and I wrote that one (unless we find a bug, in which case Ben wrote it and what's a carousel) If a user is clicking "next" we can assume they're done with all the current items.
Matt Perry reposted
π New example & tutorial: Card stack Honestly my favourite part of making this demo was realising: rotate = mix(min, max, Math.sin(index)) Nice SSR-safe alternative to Math.random() that actually provides a nicer distribution of rotations through the stack. examples.motion.dev/react/card-s...
New Motion+ Example: Material Design Ripple This animation spawns ripples wherever an element's pressed. Once upon a time I tried this effect with a single element using background-image, but multiple elements & scale allow it to be hardware accelerated. examples.motion.dev/react/materi...
I had a question on the Motion+ Discord about how you'd create port this GSAP ScrollTrigger effect to Motion. My intuition was it's doable with CSS position: sticky. There's a little trick in here with position: relative too. CSS examples.motion.dev/js/layered-s... GSAP codepen.io/GreenSock/pe...
π Just published a new example: Cursor Trail No need to wire your own pointer events: usePointerPosition() in Motion+ returns x/y motion values powered by a single site-wide event handler, throttled to the frameloop. examples.motion.dev/react/cursor...
π The Motion x @base-ui.com integration guide is out now! Additionally, Motion+ members get access to the source code of 13 Motion x Base UI examples, plus a custom LLM ruleset file. motion.dev/docs/base-ui
π Long requested (issue was 5 years old)... New children entering into a staggered list now also stagger in! As easy as delayChildren: stagger(0.2). Motion+ Infinite Loading demo and tutorial: examples.motion.dev/react/infini...
π Introducing Motion+ Typewriter! I'll let it speak for itself... motion.dev/docs/react-typewriter
π New Motion+ example: Scroll Highlight Use Motion's inView function to highlight items as they hit a certain point in the viewport. Built on IntersectionObserver, it's more performant than scroll tracking. examples.motion.dev/react/scroll...
Also available for JS and Vue examples.motion.dev/js/scroll-hi... examples.motion.dev/vue/scroll-h...
Many thanks to Build UI for supporting Motion from the very start π Now that Build UI is winding down we're looking for new sponsors! Support Motion, get your brand in front of over 100k developers a month, and receive Motion+ for your whole team: motion.dev/sponsor
π Improved error messaging in Motion Starting with the most common, error messages and warnings will increasingly provide a link to a page that explains the error message in more detail, and offers solutions. i.e motion.dev/error/no-val...
π¨ Motion Studio is in development. The landing page is a proper CSS & Motion transition editor, built using the upcoming Motion Studio SDK. Changes are saved via the URL, so you can bookmark your faves! Build your transitions now: motion.dev/studio
Check out the live example: examples.motion.dev/react/ticker...
Motion 12.19 adds the usePageInView() hook for responding to changes in tab visibility. Pause animations and videos in background tabs for CPU-friendly websites πΏ motion.dev/docs/react-u...
Motion+ users can now use the bezier curve editor in @vscode.dev! Directly edit CSS and Motion via the GUI, and preview in real-time. motion.dev/docs/tools-vs-code-extension
Level up your animations in @vscode.dev with the new Motion for VS Code extension! π Add Motion docs to Copilot π€ Generate CSS springs π€« More non-AI dev tools coming soon π marketplace.visualstudio.com/items?itemName=Motion.motion-vscode-extension
I think MCPs are a big part of the solution here, at least for OSS. Motion for AI sits inside your editor and gives you docs without ever having to hit the website. So from here, what's the upsell? That's the exercise for this year. motion.dev/docs/ai-quick-start
That's not to say I don't see this risk. I'm all in on AI. I just think if you're building something actually new, like my approach to child cloning in the Motion+ Ticker motion.dev/blog/buildin... then I fail to see how LLMs could ever do this from a first principles perspective
So I think the bigger risk for me is people never getting to see the Ticker, or Cursor etc, because they're never on the website, and therefore never want to buy it. This is true of all AI editors, @diabrowser.com etc. I also think the web is so bad now that it does need an AI layer
It's still small compared to Google, but ChatGPT was last week the second largest source of motion.dev traffic. This has grown from nothing 3 months ago. Perhaps this growth will continue but from my own experience you can use a library and never hit the source docs
π Motion+ Ticker is now available for Vue! The ultimate accessible ticker, with keyboard nav, velocity-defined animations and optimal cloning strategy. Docs: motion.dev/docs/vue-ticker or braindump directly into your LLM with the Motion+ MCP π€
π€ Introducing Motion for AI Supercharge your LLM with the new Motion MCP: β’ CSS spring and bounce generators β’ Spring and easing visualisations β’ Documentation Plus Motion+ Rules and vibe coding guides for @framer.com, @v0.dev, and @figma.com Get started now: motion.dev/docs/ai-quick-start
π Introducing Motion+ Ticker for React Lightweight, accessible, multi-axis, performant, flexible, responsive. This is the ultimate ticker component. Let's dive in π€Ώ motion.dev/blog/buildin...
π Introducing Motion+ Ticker for React Lightweight, accessible, multi-axis, performant, flexible, responsive. This is the ultimate ticker component. Let's dive in π€Ώ motion.dev/blog/buildin...
By default, a velocity-based animation will automatically play. A hoverFactor prop can adjust the velocity on hover. But an offset motion value can be passed through to control the ticker manually. Scroll or drag-driven tickers are a motion value away. examples.motion.dev/react#ticker
π Introducing resize() in Motion 12.16! This tiny utility has a simple API for tracking changes to viewport and element size. Element tracking uses a single shared ResizeObserver for optimal performance. π motion.dev/docs/resize