Star Filled
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 star-filled --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 StarFilledIcon({ disableHover, className }: Props) {
const classes = [
"ai-star-filled-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-star-filled-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-star-filled-icon * {
transform-box: fill-box;
}
.ai-star-filled-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
.ai-star-filled-icon .star {
transform-origin: center;
}
.ai-star-filled-icon:not(.no-hover):hover .star {
animation: ai-star-filled-twinkle 700ms ease-in-out;
}
@keyframes ai-star-filled-twinkle {
0%, 100% { transform: rotate(0) scale(1); }
50% { transform: rotate(20deg) scale(1.15); }
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<path className="star" d="M7.22257 0.665927C7.32508 0.419634 7.67476 0.419617 7.77726 0.665927L9.413 4.6005C9.45615 4.70425 9.55396 4.77497 9.66593 4.78409L13.914 5.12491C14.1799 5.14635 14.2875 5.47869 14.0849 5.65226L10.8485 8.42374C10.7632 8.49693 10.7258 8.61221 10.7519 8.72159L11.7411 12.8661C11.803 13.1256 11.5206 13.331 11.2929 13.1923L7.65616 10.9706C7.56022 10.9121 7.43961 10.9121 7.34366 10.9706L3.70694 13.1923C3.47926 13.3311 3.19681 13.1256 3.2587 12.8661L4.24796 8.72159C4.27405 8.61223 4.23661 8.49693 4.15128 8.42374L0.914951 5.65226C0.712311 5.47867 0.819914 5.1463 1.08585 5.12491L5.3339 4.78409C5.44584 4.77494 5.54368 4.70422 5.58683 4.6005L7.22257 0.665927Z" fill="currentColor"/>
</svg>
</>
);
}