Strikethrough
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 strikethrough --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 StrikethroughIcon({ disableHover, className }: Props) {
const classes = [
"ai-strikethrough-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-strikethrough-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-strikethrough-icon * {
transform-box: fill-box;
}
.ai-strikethrough-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
.ai-strikethrough-icon .line {
stroke-dasharray: 10;
}
.ai-strikethrough-icon:not(.no-hover):hover .line {
animation: ai-strikethrough-draw 700ms ease-in-out;
}
@keyframes ai-strikethrough-draw {
0% { stroke-dashoffset: 0; }
50% { stroke-dashoffset: -10; }
100% { stroke-dashoffset: -20; }
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<path className="letter" d="M10.5003 2.75C10.7763 2.75018 11.0003 2.97397 11.0003 3.25V7.09961H12.5003V7.90039H11.0003V8.5498C11.0003 10.4827 9.43315 12.0496 7.50031 12.0498C5.56731 12.0498 4.00031 10.4828 4.00031 8.5498V7.90039H2.50031V7.09961H4.00031V3.25C4.00031 2.97386 4.22416 2.75 4.50031 2.75C4.77629 2.75018 5.00031 2.97397 5.00031 3.25V7.09961H10.0003V3.25C10.0003 2.97386 10.2242 2.75 10.5003 2.75ZM5.00031 7.90039V8.5498C5.00031 9.93052 6.11959 11.0498 7.50031 11.0498C8.88086 11.0496 10.0003 9.9304 10.0003 8.5498V7.90039H5.00031Z" fill="currentColor"/>
<path className="line" d="M2.5 7.5L12.5 7.5" stroke="currentColor" strokeWidth="0.8" strokeLinecap="round"/>
</svg>
</>
);
}