04.25 · Micro-Interactions

Copy to Clipboard

Copy turns into a tick and Copied, then changes back. Best for codes and links.

Click it

Press Copy and watch the button confirm, then change back, or press Show me.

Your invite code MOTION-2026

Try it

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

Speed

How quickly the icon and label change.

Time before it changes back

How long Copied! stays before the button resets.

More optionsFewer options

Feel

Springy gives the tick a small bounce.

Copy the prompt

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

Add copy feedback to [the Copy button next to your code, link or key]. When the copy succeeds, turn the button's icon into a tick and its label into Copied!, with a brief flash of color, then change it back on its own after a moment so it is ready to use again. Stack both icons and both labels in the same place so the change never shifts the layout. Show the confirmation only once the copy has really worked, tell screen readers with a short status message, and say so if copying fails. If the visitor has reduced motion turned on, swap the icon and label without movement. 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

  • Share links
  • Invite codes
  • Code blocks
  • API keys

Avoid on

  • Slow actions
  • Important saves