Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Transitions and Easing | Animating Components
Animations in React with Framer Motion

bookTransitions and Easing

When you want to create smooth and engaging animations in your React app using Framer Motion, the transition prop is your primary tool for controlling the timing and style of those animations. The transition prop lets you specify how an animation should progress over time, and it accepts several options to fine-tune the effect:

  • Duration: controls how long the animation takes from start to finish;
  • Delay: sets how long to wait before the animation begins;
  • Type: determines the kind of animation (such as tween, spring, or inertia);
  • Easing: shapes the speed curve of the animation, making it feel more natural or stylized;
  • Repeat: allows the animation to play multiple times or loop.

For example, if you want an element to fade in over two seconds after a brief pause, you can use the duration and delay options together. The type option lets you switch between different animation engines, like a simple tween for linear movement or a spring for more dynamic, bouncy effects. By combining these options, you gain precise control over how your animations look and feel.

A key part of making animations feel lifelike is the use of easing functions. Easing functions define how an animation accelerates or decelerates over its duration, affecting the overall rhythm and energy. Framer Motion supports several built-in easing functions, each with distinctive visual effects:

  • Linear: moves at a constant speed, creating a mechanical feel;
  • Ease-in: starts slow and speeds up, ideal for elements entering the screen;
  • Ease-out: starts fast and slows down, often used for elements exiting smoothly;
  • Ease-in-out: starts and ends slowly, with a faster middle, giving a natural, organic motion;
  • Custom cubic-bezier: lets you define your own acceleration curve for advanced control.

Choosing the right easing function can make your interface feel more responsive and intuitive. For example, using ease-out for a modal closing animation gives users a sense of closure, while ease-in for a button appearing can draw attention without feeling abrupt.

Note
Definition

Easing functions are mathematical formulas that control the acceleration and deceleration of an animation. By shaping how quickly or slowly an animated value changes over time, easing functions influence how natural or dynamic an animation feels to users. The right easing can make transitions seem smooth and intentional, improving the overall user experience.

question mark

Which transition prop option in Framer Motion directly controls how long an animation takes to complete?

Select the correct answer

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 3

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

What are some examples of using different transition options in Framer Motion?

Can you explain how to choose the best easing function for a specific animation?

How do I combine multiple transition properties for a more complex animation?

bookTransitions and Easing

Desliza para mostrar el menú

When you want to create smooth and engaging animations in your React app using Framer Motion, the transition prop is your primary tool for controlling the timing and style of those animations. The transition prop lets you specify how an animation should progress over time, and it accepts several options to fine-tune the effect:

  • Duration: controls how long the animation takes from start to finish;
  • Delay: sets how long to wait before the animation begins;
  • Type: determines the kind of animation (such as tween, spring, or inertia);
  • Easing: shapes the speed curve of the animation, making it feel more natural or stylized;
  • Repeat: allows the animation to play multiple times or loop.

For example, if you want an element to fade in over two seconds after a brief pause, you can use the duration and delay options together. The type option lets you switch between different animation engines, like a simple tween for linear movement or a spring for more dynamic, bouncy effects. By combining these options, you gain precise control over how your animations look and feel.

A key part of making animations feel lifelike is the use of easing functions. Easing functions define how an animation accelerates or decelerates over its duration, affecting the overall rhythm and energy. Framer Motion supports several built-in easing functions, each with distinctive visual effects:

  • Linear: moves at a constant speed, creating a mechanical feel;
  • Ease-in: starts slow and speeds up, ideal for elements entering the screen;
  • Ease-out: starts fast and slows down, often used for elements exiting smoothly;
  • Ease-in-out: starts and ends slowly, with a faster middle, giving a natural, organic motion;
  • Custom cubic-bezier: lets you define your own acceleration curve for advanced control.

Choosing the right easing function can make your interface feel more responsive and intuitive. For example, using ease-out for a modal closing animation gives users a sense of closure, while ease-in for a button appearing can draw attention without feeling abrupt.

Note
Definition

Easing functions are mathematical formulas that control the acceleration and deceleration of an animation. By shaping how quickly or slowly an animated value changes over time, easing functions influence how natural or dynamic an animation feels to users. The right easing can make transitions seem smooth and intentional, improving the overall user experience.

question mark

Which transition prop option in Framer Motion directly controls how long an animation takes to complete?

Select the correct answer

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 3
some-alt