Component Placeholder
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 component-placeholder --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 ComponentPlaceholderIcon({ disableHover, className }: Props) {
const classes = [
"ai-component-placeholder-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-component-placeholder-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-component-placeholder-icon * {
transform-box: fill-box;
}
.ai-component-placeholder-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
.ai-component-placeholder-icon:not(.no-hover):hover .diamond {
animation: ai-component-placeholder-march 700ms linear;
}
@keyframes ai-component-placeholder-march {
from { stroke-dashoffset: 0; }
to { stroke-dashoffset: -8; }
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<path className="diamond" d="M7.5 1.5L13.5 7.5L7.5 13.5L1.5 7.5Z" stroke="currentColor" strokeWidth="1" strokeLinecap="round" stroke-dasharray="0 2"/>
</svg>
</>
);
}