---
title: "How We Built the Add to Favorite Animation in Shop"
description: "Shop's Add to Favorite animation, where a product thumbnail pops in, scales, and drops into a bouncing heart tab-bar icon, is built in React Native with Reanimated by driving the whole sequence from a single shared progress value that steps through 1, 2, 3 and so on, each step with its own duration and easing from the motion spec."
url: "https://swe.quest/articles/how-we-built-the-add-to-favorite-animation-in-shop-145e9cee56a5fe21"
canonical: "https://shopify.engineering/building-add-to-favorite-animation-shop-app"
source: "Shopify Engineering"
published: "2022-03-25"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["mobile","react","frontend"]
---

# How We Built the Add to Favorite Animation in Shop

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-03-25, 7 min read, How-to. Original: [https://shopify.engineering/building-add-to-favorite-animation-shop-app](https://shopify.engineering/building-add-to-favorite-animation-shop-app)

## Summary

Shop's Add to Favorite animation, where a product thumbnail pops in, scales, and drops into a bouncing heart tab-bar icon, is built in React Native with Reanimated by driving the whole sequence from a single shared progress value that steps through 1, 2, 3 and so on, each step with its own duration and easing from the motion spec. Each property (opacity, scale, translateY, icon fill and bounce) is mapped from that progress value with clamped interpolation, and the filled heart is a second icon faded in over the outline. Using one shared value guarantees the icon moves the instant the thumbnail disappears, creating a cinematic match cut. An earlier setTimeout-based approach broke that timing when the JS thread was busy; Reanimated's withDelay keeps the timer on the UI thread.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)
- [React](https://swe.quest/tags/react.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)

## Prerequisites

- React Native basics ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- animation easing curves

## Keywords

React Native, Reanimated, Shop app, interpolate, withDelay

## Related posts

- [Making Your React Native Gestures Feel Natural](https://swe.quest/articles/making-your-react-native-gestures-feel-natural-2f601419df32539e.md): Shopify Engineering · 2023-01-20 · Medium · 5 min read · React, Mobile, Frontend
  Draggable UI in React Native feels more natural when gesture end-handling accounts for release velocity, not just finger position.
- [Custom Navigational Transitions in iOS](https://swe.quest/articles/custom-navigational-transitions-in-ios-ad9fd5ca9d18d051.md): Zalando Engineering · 2024-07-03 · Medium · 5 min read · Mobile, Swift, Frontend
  Zalando's iOS app adds a custom zoom-style push transition between backend-driven screens.
- [Getting Started with React Native Skia](https://swe.quest/articles/getting-started-with-react-native-skia-faaa1b35d50977ac.md): Shopify Engineering · 2023-12-04 · Medium · 10 min read · React, Mobile, Frontend
  React Native Skia (@shopify/react-native-skia) exposes Google's Skia 2D graphics engine to React Native, giving a cartesian canvas with shapes, paths, shaders and image filters that go beyond what View and react-native-svg handle well.
- [Management of Native Code and React Native at Shopify](https://swe.quest/articles/management-of-native-code-and-react-native-at-shopify-a1da81505efaf180.md): Shopify Engineering · 2021-04-16 · Medium · 8 min read · Mobile, React, Java & JVM, Performance engineering
  Shopify's Point of Sale team kept complex UI such as a draggable, reorderable grid of hundreds of buttons in React Native, fixing performance with fewer re-renders, lazy rendering, memoization and Reanimated 2.
- [Lessons From Building Android Widgets](https://swe.quest/articles/lessons-from-building-android-widgets-3b8b116282223e62.md): Shopify Engineering · 2022-09-22 · Medium · 19 min read · Mobile, Caching
  Shopify built its Android analytics widgets natively rather than in React Native, because widgets must be built from RemoteViews, which React Native does not support.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
