Eraser
Install
npm install @svg-animated-icons/reactCLI
Copy an icon component straight into your project — shadcn-style. Replace {icon} with an icon name like arrow-left.
terminal
npx @svg-animated-icons/cli add {icon} --react| Flag | Description |
|---|---|
--dest <dir> | Destination directory (default: components/animated-icons) |
Or copy the component with the CLI
CLI
npx @svg-animated-icons/cli add eraser --reactCode
React
// Generated by @svg-animated-icons/cli
// You own this file — edit it freely.
import React from "react";
type Props = {
disableHover?: boolean;
className?: string;
};
export function EraserIcon({ disableHover, className }: Props) {
const classes = [
"ai-eraser-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-eraser-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-eraser-icon * {
transform-box: fill-box;
}
.ai-eraser-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
.ai-eraser-icon .eraser {
transform-origin: center;
}
.ai-eraser-icon:not(.no-hover):hover .eraser {
animation: ai-eraser-motion 700ms ease-in-out;
}
@keyframes ai-eraser-motion {
0%, 100% { transform: translate(0, 0); }
25% { transform: translate(-1px, 1px); }
75% { transform: translate(1px, -1px); }
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<path className="eraser" d="M8.36026 0.729266C8.55547 0.534048 8.87201 0.534137 9.06729 0.729266L14.2704 5.93239L14.3349 6.01052C14.4631 6.20461 14.4413 6.46852 14.2704 6.63942L7.34658 13.5633C6.76081 14.149 5.81128 14.149 5.22549 13.5633L1.43643 9.77419C0.88738 9.22493 0.853223 8.35644 1.33389 7.76735L1.43643 7.65309L8.36026 0.729266ZM2.14346 8.36013C1.94827 8.55532 1.9484 8.87188 2.14346 9.06716L5.93252 12.8562C6.12779 13.0514 6.4443 13.0515 6.63955 12.8562L7.89443 11.6013L3.39834 7.10524L2.14346 8.36013ZM4.10537 6.39821L8.60147 10.8943L13.2099 6.28591L8.71377 1.78981L4.10537 6.39821Z" fill="currentColor"/>
</svg>
</>
);
}