Practical Guide to Animation in React

Bookmark
Rate this content

Small animations can make UIs more delightful and improve user experience. In this talk, we’ll explore how to add these animation to your React apps, using everything from simple CSS transitions to more complex spring-based motion.

We'll walk through practical examples to show how these animations can enhance user experience without getting in the way. Plus, we'll discuss how to keep them running smoothly and make sure they're accessible to everyone.

This talk has been presented at React Summit US 2025, check out the latest edition of this React Conference.

FAQ

In Apple Photos, tapping on a picture scales it from the tapped location, creating a clear connection between interaction and result. In Netflix, avatars animate onto the toolbar to indicate where account changes can be made post-login, enhancing usability.

CSS transitions animate properties when they change, using start and end values for smooth transitions. CSS animations use keyframes for more complex, reusable animations with multiple steps, suitable for entry and exit animations.

Timing functions in CSS animations define how the animation progresses, affecting the rate of change. They help create more natural and realistic animations by controlling speed variations throughout the animation.

View Transitions, a web platform API, allow for native app-like interactions by animating between snapshots of states. They facilitate seamless transitions between states and can be customized for unique animations.

Spring-based animation provides more natural and responsive animations by simulating real-world physics, such as weight and resistance, resulting in animations that feel alive and sophisticated.

Developers can use libraries like Framer Motion to implement Spring-based animations in React, offering intuitive APIs for creating responsive and natural-looking animations.

Animations can be made accessible by respecting user motion preferences set in device settings and using the Reduced Motion Media query to disable or minimize animations for sensitive users.

Developers can use CSS, JavaScript APIs, libraries like Framer Motion, and View Transitions API to create advanced animations that enhance user experience in web applications.

Animation adds joy, whimsy, and delight to UI, creating a personal connection with users and differentiating products in a market where AI-generated UIs are common.

Animations help bridge the gap between instant changes in web interfaces and natural, real-world motion, making UIs feel more tangible and improving user experience.

Kateryna Porshnieva
Kateryna Porshnieva
27 min
21 Nov, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
The importance of animations in enhancing user experience by bridging the gap between user expectations and digital interfaces. Practical examples of creating animations using CSS transitions and keyframes for smooth and complex effects. Utilizing timing functions with cubic Bezier curves for diverse animations and accessibility considerations. Introducing Vue Transitions as a powerful web API for seamless animations with broad browser support. Customizing Vue Transitions for unique effects, optimizing usage with unique names and global disabling, and transitioning to Spring-based animations for natural UI interactions. Exploring FramerMotion and Motion Library for React animations, configuring spring behavior for smooth effects, and enhancing animations with Motion and CSS for improved user experience.

1. Exploring the Power of Animations

Short description:

The importance of animations in bridging the gap between user expectations and digital interfaces. Examples showcasing how animation can enhance user experience by adding tangibility, direction, joy, and personal connection. Emphasizing the significance of animations in making UIs feel more realistic and engaging.

Hello, everyone. I'm super excited to talk to you about animations. In our web interfaces, most of the changes happen instantly. You click a button and then boom, some content just teleports onto the screen. But that's not how things work in the real world, right? Typically, changes in state involve some kind of motion and our brains have been wired to understand it because we've been observing physics of the world around us our whole lives. And this can make interfaces feel a little bit mechanical and disconnected from how we naturally expect things to behave. And animation can help bridge that gap.

It can help make UIs feel more tangible and real and do powerful things for user experience. Like here in the Apple Photos app, when I tap on a picture, it scales exactly from the place I tapped, creating this clear connection between the interaction and the end result. Or this animation when you log in into the Netflix account where avatar animates onto the toolbar. By doing that, it also communicates where you can change your account later after you've logged in. Or think about the calendar interface where clicking between the navigation buttons, the content slides left or right, communicating direction and giving you visual feedback which side you're moving to.

Our brains are also wired to detect motion and Figma uses it by shaking the comment box when you're trying to dismiss an unfinished comment. Or look how Airbnb highlights important information for customers when searching for properties. If animation wasn't there, it would have been really easy to miss. Animation can also be used to add a little bit of joy, whimsy and delight into otherwise static UI. Look at this 3D animated icons in Airbnb. Or this character animation in Notion AI. Things like this might seem small, but they create a personal connection between the user and the UI, and also help them to feel joyful when they are using your product. Especially right now when it becomes easier and easier to generate UI using AI tools, animation and a lot of this attention to detail can really differentiate your product among others.

2. Mastering CSS Animations

Short description:

Exploring CSS Animations: Practical examples on creating animations, utilizing CSS transitions and keyframes for smooth and complex animations with timing functions.

As developers, we have quite a few tools at our disposal to create animations. We have CSS and some JavaScript APIs and web platform APIs and a lot of libraries. In this talk we'll explore quite a few practical examples on how we can add meaningful motion in our UIs and how we can use all of these tools to do that. But first let me introduce myself. My name is Katrina. I am originally Ukrainian, but I'm currently tuning in from Tallinn, Estonia. And I work remotely at Buffer where I drive our front-end direction. And lately at Buffer I've been investing more and more into UI details like this. We've got quite a lot of content to cover, so let's start.

Let's start with CSS animation. This is the most accessible tool for creating animation we have, and it's a great foundation for most of the animations you're going to create. In CSS, there's generally two main ways to create animations. We can use CSS transitions and CSS animations using keyframes. Transitions are the simplest, they let us animate properties when they change. Like here we are animating opacity over the duration of 300 milliseconds when hovering. Taking start and end values, browser then interpolates all of the values in between to create a smooth transition. This process is also called tween animation, from in-between states that browser needs to calculate. This way we can animate any property that can be interpolated like transforms, opacity changes, colors, padding, width and height, etc.

But sometimes when we want to animate more than between the two states, that's where the keyframes and CSS animations come in. They let us create reusable animations with multiple steps. For example, here we have a spinning animation that we apply to the spinner, but then we can apply the same animation to a completely different element in different contexts. Keyframes are great for any entry and exit animations, for example, like here. Notice that I'm creating a partial keyframe where I'm defining only start or end keyframe, and then the browser will fill in the gap using elements' own styles. Then we can also apply different animation for opening and closing. And also look how here I'm using a duration that's longer for opening than for closing. It makes closing the menu feel a lot snappier. We can also create complex multi-step animations using keyframes, like here, where we shake the element rotating and moving it multiple times throughout the animation. And then by applying it to the common box, we can recreate the same animation from Figma that we saw in the beginning. One big part that can make CSS animations feel a lot more realistic and natural are timing and timing functions. There are five built-in timing functions and ease is the default one, and this can really affect a lot how animation feels.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Vue: Feature Updates
Vue.js London 2023Vue.js London 2023
44 min
Vue: Feature Updates
Top Content
Watch video: Vue: Feature Updates
The Talk discusses the recent feature updates in Vue 3.3, focusing on script setup and TypeScript support. It covers improvements in defining props using imported types and complex types support. The introduction of generic components and reworked signatures for defined components provides more flexibility and better type support. Other features include automatic inference of runtime props, improved define emits and defined slots, and experimental features like reactive props destructure and define model. The Talk also mentions future plans for Vue, including stabilizing suspense and enhancing computer invalidations.
The Whimsical Potential of JavaScript Frameworks
React Summit US 2023React Summit US 2023
28 min
The Whimsical Potential of JavaScript Frameworks
Top Content
Watch video: The Whimsical Potential of JavaScript Frameworks
The speaker discusses the whimsical and detailed work of Stripe, particularly their interactive and dynamic pages. They explain the use of React for building whimsical details and tracking mouse position. The speaker introduces React Spring for smooth animation and React3 Fiber for creating a 3D egg model. They also mention the use of Framer Motion and React server components for animating CSS properties.
Accessibility at Discord
React Advanced 2021React Advanced 2021
22 min
Accessibility at Discord
Top Content
This Talk discusses the accessibility efforts at Discord, focusing on keyboard navigation and the challenges faced with implementing focus rings and outlines. The speaker showcases a unified focus ring system and a saturation slider to address accessibility concerns. They also highlight the implementation of role colors and the use of CSS filters for accessibility improvements. The Talk concludes with insights on runtime accessibility checking and the development of a performant core runtime system for checking accessibility issues.
Emotional & Functional UI Animations in React
React Day Berlin 2022React Day Berlin 2022
28 min
Emotional & Functional UI Animations in React
Today's Talk discussed the importance of UI animations in React, both functional and emotional. Examples were given using CSS and Framer Motion, with a focus on user feedback and accessibility. Design guidelines and animation usage were highlighted, as well as the consideration of negative emotions in animations. The Talk also touched on designing 404 error pages and concluded with gratitude to the audience and organizers.
Future of Frontend Frameworks Fireside Chat
React Summit 2024React Summit 2024
28 min
Future of Frontend Frameworks Fireside Chat
Fred K. Schott
Minko Gechev
Ryan Carniato
Daniel Afonso
Aakansha Doshi
Tim Neutkens
6 authors
Signals are being adopted by popular frameworks, enabling code reuse and improved tooling. While merging between frameworks is unlikely, they are learning from each other and adopting shared practices. It is important to embrace the diversity of frameworks and libraries. Instead of merging, focus on standardizing the principles behind frameworks. Consider tradeoffs and benefits when choosing a framework, and explore different technologies to learn new ideas.
AI + UX: Product Design for Intelligent Experiences
C3 Dev Festival 2024C3 Dev Festival 2024
28 min
AI + UX: Product Design for Intelligent Experiences
Premium
AI design challenges include bias, safety, and security. Trust and transparency are important in AI. Design principles for AI include user control, fighting bias, and promoting good decision-making. AI can enable the design process and investors expect to see it included in products. AI empowers individuals to create and share ideas, but managing expectations is crucial.

Workshops on related topic

How to make amazing generative art with simple JavaScript code
JS GameDev Summit 2022JS GameDev Summit 2022
165 min
How to make amazing generative art with simple JavaScript code
Top Content
Workshop
Frank Force
Frank Force
Instead of manually drawing each image like traditional art, generative artists write programs that are capable of producing a variety of results. In this workshop you will learn how to create incredible generative art using only a web browser and text editor. Starting with basic concepts and building towards advanced theory, we will cover everything you need to know.
Web Accessibility for Ninjas: A Practical Approach for Creating Accessible Web Applications
React Summit 2023React Summit 2023
109 min
Web Accessibility for Ninjas: A Practical Approach for Creating Accessible Web Applications
Workshop
Asaf Shochet Avida
Eitan Noy
2 authors
In this hands-on workshop, we’ll equip you with the tools and techniques you need to create accessible web applications. We’ll explore the principles of inclusive design and learn how to test our websites using assistive technology to ensure that they work for everyone.
We’ll cover topics such as semantic markup, ARIA roles, accessible forms, and navigation, and then dive into coding exercises where you’ll get to apply what you’ve learned. We’ll use automated testing tools to validate our work and ensure that we meet accessibility standards.
By the end of this workshop, you’ll be equipped with the knowledge and skills to create accessible websites that work for everyone, and you’ll have hands-on experience using the latest techniques and tools for inclusive design and testing. Join us for this awesome coding workshop and become a ninja in web accessibility and inclusive design!
Automated accessibility testing with jest-axe and Lighthouse CI
TestJS Summit 2021TestJS Summit 2021
85 min
Automated accessibility testing with jest-axe and Lighthouse CI
Workshop
Bonnie Schulkin
Bonnie Schulkin
Do your automated tests include a11y checks? This workshop will cover how to get started with jest-axe to detect code-based accessibility violations, and Lighthouse CI to validate the accessibility of fully rendered pages. No amount of automated tests can replace manual accessibility testing, but these checks will make sure that your manual testers aren't doing more work than they need to.
Web Accessibility in JavaScript Apps
React Summit 2022React Summit 2022
161 min
Web Accessibility in JavaScript Apps
Workshop
Sandrina Pereira
Sandrina Pereira
Often we see JavaScript damaging the accessibility of a website. In this workshop, you’ll learn how to avoid common mistakes and how to use JS in your favor to actually enhance the accessibility of your web apps!
In this workshop we’ll explore multiple real-world examples with accessibility no-nos, and you'll learn how to make them work for people using a mouse or a keyboard. You’ll also learn how screen readers are used, and I'll show you that there's no reason to be afraid of using one!
Join me and let me show you how accessibility doesn't limit your solutions or skills. On the contrary, it will make them more inclusive!
By the end, you will:- Understand WCAG principles and how they're organized- Know common cases where JavaScript is essential to accessibility- Create inclusive links, buttons and toggleble elements- Use live regions for errors and loading states- Integrate accessibility into your team workflow right away- Realize that creating accessible websites isn’t as hard as it sounds ;)