Error
Animated error icon
Error is a 1.5 s micro animation that loops continuously; use it for error and warning banners at the top of a page. Looping icons typically show loading spinners, active alerts, a ringing bell or a scroll-down hint.
Free under the MIT license · Markdown version · About the files
Use it
npm install react-useanimationsimport UseAnimations from 'react-useanimations';
import error from 'react-useanimations/lib/error';
<UseAnimations animation={error} size={32} />npx shadcn@latest add https://useanimations.com/r/error.jsonimport { AnimatedError } from '@/components/animations/error';
<AnimatedError size={24} /><div id="error-icon" style="width: 48px; height: 48px"></div>
<script src="https://cdn.jsdelivr.net/npm/lottie-web@5.13.0/build/player/lottie.min.js"></script>
<script>
const el = document.getElementById('error-icon');
const a = lottie.loadAnimation({ container: el, renderer: 'svg', loop: true, autoplay: false, path: 'https://useanimations.com/icons/error.json' });
const motion = matchMedia('(prefers-reduced-motion: reduce)');
a.addEventListener('DOMLoaded', () => { a.goToAndStop(0, true); if (!motion.matches) a.play(); });
motion.addEventListener('change', (event) => { if (event.matches) a.goToAndStop(0, true); else a.play(); });
</script>Error uses After Effects expressions: load the full lottie.min.js, not lottie_light.
import LottieView from 'lottie-react-native';
<LottieView source={{ uri: 'https://useanimations.com/icons/error.json' }} autoPlay loop style={{ width: 48, height: 48 }} />import Lottie
LottieView {
await LottieAnimation.loadedFrom(url: URL(string: "https://useanimations.com/icons/error.json")!)
}
.playing(loopMode: .loop)
.frame(width: 48, height: 48)val composition by rememberLottieComposition(LottieCompositionSpec.Url("https://useanimations.com/icons/error.json"))
LottieAnimation(composition, iterations = LottieConstants.IterateForever, modifier = Modifier.size(48.dp))import 'package:lottie/lottie.dart';
Lottie.network('https://useanimations.com/icons/error.json', width: 48, height: 48, repeat: true)Native players may not support the After Effects expressions in error.json; check it on a device.
<img src="https://useanimations.com/icons/error/error.svg" alt="Error" width="24" height="24" />Inside <img> the SVG draws black; inline it to follow the text color.
Static SVG
Questions about the Error icon
›Can I pause the Error loop?
It pauses by itself while scrolled out of view and stays on its first frame when reduced motion is preferred or autoplay={false} is set. To show it only while something is pending, render it conditionally.
›Is Error decorative?
By default it is aria-hidden. Pass aria-label="Error" to announce it as an image, or leave it hidden when the link or button it sits in has its own text.
›Can Error loop only while hovered instead?
Yes: pass interaction="hover-loop". It then loops while hovered, finishes the current cycle after mouseleave and stays static when reduced motion is preferred.