Skip to main content

React animation example

React Animated Icons: Like Heart With Burst

The like button is the most-tapped icon in most apps, so its animation does real work. This heart squashes on press, pops past its final size, throws a ring and a burst of particles, and ticks the counter. Unliking is deliberately quieter: a quick shrink and a fade back to the outline.

  • 4.2 KB file
  • 5 live inputs
  • React runtime
Live, try it

How this like heart icon works

  • Scale is a spring that gets a negative kick on press and a positive one on release, which gives the pop.
  • The burst ring expands and thins in 400 ms; particles inherit two accent colors.
  • The liked state is a real input, so you can set it from your data and listen for "like" and "unlike".

Add it to your React app

Install exodeui, download the file below, and paste this. The code updates as you customize. Other runtimes are in the other tabs.

import { ExodeUICanvas } from 'exodeui';

// react-animated-icons.bexode goes in /public (download it below)
export function ReactAnimatedIcons() {
  return (
    <ExodeUICanvas
      src="/react-animated-icons.bexode"
      fit="Layout"
      autoPlay
      interactive
      onTrigger={(name) => {
        // fires: 'like', 'unlike'
      }}
      style={{ width: '100%', height: 400 }}
    />
  );
}

Inputs

InputTypeDefaultRange
likedBooleanfalse—
countNumber1280 – 99999
accentText#f43f5ehex colour
accent2Text#fbbf24hex colour
bgText#0f0a0chex colour

Events: likeunlike

More React animations

The same idea in other frameworks: Flutter morphing icons · SwiftUI symbol effects · JavaScript success checkmark