← Back

Value

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

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

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

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

.ai-value-icon .ring {
  transform-box: view-box;
  transform-origin: 7.5px 7.5px;
}

.ai-value-icon:not(.no-hover):hover .ring {
  animation: ai-value-spin 700ms ease-in-out;
}

@keyframes ai-value-spin {
  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.49915 0.877045C11.1566 0.877045 14.1218 3.84178 14.1222 7.49911C14.1222 11.1568 11.1568 14.1222 7.49915 14.1222C3.84181 14.1218 0.877075 11.1565 0.877075 7.49911C0.877487 3.84203 3.84206 0.877456 7.49915 0.877045ZM7.49915 1.82626C4.36674 1.82667 1.82671 4.3667 1.82629 7.49911C1.82629 10.6319 4.36648 13.1716 7.49915 13.172C10.6321 13.172 13.172 10.6321 13.172 7.49911C13.1716 4.36645 10.6319 1.82626 7.49915 1.82626Z" fill="currentColor"/>
      </svg>
    </>
  );
}