← Back

Pie Chart

Install

npm install @svg-animated-icons/react

CLI

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
FlagDescription
--dest <dir>Destination directory (default: components/animated-icons)

Or copy the component with the CLI

CLI
npx @svg-animated-icons/cli add pie-chart --react

Code

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 PieChartIcon({ disableHover, className }: Props) {
  const classes = [
    "ai-pie-chart-icon",
    disableHover ? "no-hover" : "",
    className ?? "",
  ]
    .filter(Boolean)
    .join(" ");

  return (
    <>
      <style>{`
.ai-pie-chart-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  cursor: pointer;
  overflow: visible;
}

.ai-pie-chart-icon * {
  transform-box: fill-box;
}

.ai-pie-chart-icon.no-hover * {
  transform: none;
  opacity: 1;
  animation: none;
}

.ai-pie-chart-icon .slice {
  transform-box: view-box;
  transform-origin: 7.5px 7.5px;
}

.ai-pie-chart-icon:not(.no-hover):hover .slice {
  animation: ai-pie-chart-sweep 700ms ease-in-out;
}

@keyframes ai-pie-chart-sweep {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="ring" d="M7.5004 0.850006C11.1729 0.850217 14.1498 3.82765 14.1498 7.5004C14.1498 11.1732 11.1729 14.1506 7.5004 14.1508C3.82767 14.1508 0.850006 11.1733 0.850006 7.5004C0.850024 3.82752 3.82768 0.850006 7.5004 0.850006ZM7.5004 1.85001C4.38003 1.85001 1.85002 4.37974 1.85001 7.5004C1.85001 10.6211 4.38002 13.1508 7.5004 13.1508C10.6206 13.1506 13.1498 10.6209 13.1498 7.5004C13.1498 4.37987 10.6206 1.85022 7.5004 1.85001Z" fill="currentColor"/>
        <path className="slice" d="M7.5004 3.10001C9.93026 3.10022 11.9008 5.07026 11.9008 7.5004C11.9008 7.66946 11.89 7.83629 11.8715 8.0004H7.0004V3.12833C7.16438 3.10979 7.33146 3.10001 7.5004 3.10001Z" fill="currentColor"/>
      </svg>
    </>
  );
}