04.08 · Micro-Interactions

Success Confetti

Confetti bursts from the button when a task is done. Best for big moments.

Click it

Click or tap Place order (again for another burst), or press Show me.

Try it

Change a setting, then try it again or press Show me.

Amount of confetti

More pieces look fuller but cost more on phones.

Spread

Narrow shoots up like a fountain; wide fills a dome.

Fall speed

How quickly the pieces fall back down.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a confetti burst to [the action that completes something important, such as placing an order]. When it succeeds, turn the button into a clear success state with a check mark and a short confirmation, and fire small colored rectangles from the button: they shoot upward in a fan, spin, slow down, fall and fade. Save it for real milestones, not everyday clicks. Draw the pieces on one layer and stop drawing once the last one has faded or fallen out of view. If the visitor has reduced motion turned on, show the success state without the confetti. Match the settings listed below.

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 GitHub

What it is

The full explanation is in README.md.

Good for

  • Orders placed
  • Sign-ups finished
  • Milestones

Avoid on

  • Everyday clicks
  • Serious tasks