Copy
Animated copy icon
Use the Copy icon for attachment and copy-to-clipboard buttons: it plays on hover and reverses on mouse leave and takes 0.17 s. Hover icons typically mark navigation items, delete buttons, settings, zoom controls and social links.
Free under the MIT license · Markdown version · About the files
Use it
npm install react-useanimationsimport UseAnimations from 'react-useanimations';
import copy from 'react-useanimations/lib/copy';
<UseAnimations animation={copy} size={32} />npx shadcn@latest add https://useanimations.com/r/copy.jsonimport { AnimatedCopy } from '@/components/animations/copy';
<AnimatedCopy size={24} /><div id="copy-icon" style="width: 48px; height: 48px"></div>
<script src="https://cdn.jsdelivr.net/npm/lottie-web@5.13.0/build/player/lottie_light.min.js"></script>
<script>
const el = document.getElementById('copy-icon');
const a = lottie.loadAnimation({ container: el, renderer: 'svg', loop: false, autoplay: false, path: 'https://useanimations.com/icons/copy.json' });
el.addEventListener('mouseenter', () => { a.setDirection(1); a.play(); });
el.addEventListener('mouseleave', () => { a.setDirection(-1); a.play(); });
</script>Copy runs on the light build, lottie_light.min.js.
import LottieView from 'lottie-react-native';
<LottieView source={{ uri: 'https://useanimations.com/icons/copy.json' }} autoPlay loop={false} style={{ width: 48, height: 48 }} />import Lottie
LottieView {
await LottieAnimation.loadedFrom(url: URL(string: "https://useanimations.com/icons/copy.json")!)
}
.playing(loopMode: .playOnce)
.frame(width: 48, height: 48)val composition by rememberLottieComposition(LottieCompositionSpec.Url("https://useanimations.com/icons/copy.json"))
LottieAnimation(composition, iterations = 1, modifier = Modifier.size(48.dp))import 'package:lottie/lottie.dart';
Lottie.network('https://useanimations.com/icons/copy.json', width: 48, height: 48, repeat: false)Bundle copy.json with the app to use it offline.
<img src="https://useanimations.com/icons/copy/copy.svg" alt="Copy" width="24" height="24" />Inside <img> the SVG draws black; inline it to follow the text color.
Static SVG
Questions about the Copy icon
›What does Copy do when the pointer leaves halfway?
It reverses from the frame it reached back to the start, so a quick pass of the pointer gives a short nudge rather than the full 0.17 s. Taps on touch screens are ignored, but keyboard focus plays it.
›Will screen readers read the Copy icon?
By default it is aria-hidden. Pass aria-label="Copy" to announce it as an image, or leave it hidden when the link or button it sits in has its own text.
›Can Copy play on click instead?
Yes: pass interaction="click-replay". It then replays once from the start on every click unless reduced motion is preferred.