04.07 · Micro-Interactions
Heart / Like Burst
The heart pops and fills as small hearts burst out. Best for like buttons.
Click it
Click or tap the heart to like it and again to unlike it, or press Show me.
Inside, the lines are the paths the pieces fly, pulled down as they fade; the rings show how the heart squashes and swells. Click the heart, or press Show me.
Shown just after a like: Color only fills the heart; Pops and bursts also pops it and sprays small hearts. Click the heart, or press Show me.
Try it
Change a setting, then try it again or press Show me.
Number of hearts
More pieces make a bigger celebration.
How far they fly
How far the pieces travel before they fade.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a like button with a burst to [the heart or favorite button you want to reward]. When the visitor likes something, the heart quickly squashes, overshoots a little and settles as it fills with color, while a spray of tiny hearts and dots flies out from its center, arcs down and fades. Unliking simply removes the color, with no burst. Draw the burst on one layer over the button and stop drawing once the last piece has faded. Tell screen readers whether it is liked. If the visitor has reduced motion turned on, only fill the heart, with no pop or burst. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.