

Whereas values like opacity or color will be animated with a tween. For instance, physical properties like x or scale will be animated via a spring simulation. A style set on the component itself, for example a change in width or position. That could be any combination of: Reordering of a list.

Any layout change that happens as the result of a re-render will be animated. To start, let’s create a new component for our animated text, such as AnimatedTitle.js – this way we’ll be able to re-use the component with whatever text we’d like throughout our site. By default, Motion will create an appropriate animation for a snappy transition based on the types of value being animated. To enable Framer Motion's layout animations, we simply set the layout prop of a motion component. I’ll also be using styled-components for CSS, although any styling methods will work.
FRAMER MOTION ANIMATION EXAMPLES INSTALL
The easiest way to use this with React is to install the react-intersection-observer package, which will give us some nice hooks to work with: The Intersection Observer Web API is used to detect when an element moves into the viewport. Off the bat, Framer Motion is an animation library for React, so you’ll need to be working on a React project to follow along – I’m using NextJS. Share media, collect feedback, manage reviews, and deliver finished work faster. C o o l a n i m a t e d t e x t ! Reload Prerequisites Frame.io is the worlds leading video review and collaboration platform.
