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.
Inside, both icons and both words share one spot each, so the button never changes size; the bar shows how long the confirmation stays. Press Copy, or Show me.
No sign: the code is copied but nothing shows it; Confirms: a tick, a green flash and Copied tell you it worked. Press the button under Confirms, or Show me.
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.
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.
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.