← Back

Size

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

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

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

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

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

.ai-size-icon:not(.no-hover):hover .size {
  animation: ai-size-expand 700ms ease-in-out;
}

@keyframes ai-size-expand {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="size" d="M11.591 3.05881C11.7959 3.10085 11.9503 3.28294 11.9504 3.50021V7.49924L11.9406 7.59103C11.8985 7.79574 11.7173 7.94924 11.5002 7.94943C11.2828 7.94933 11.1007 7.79513 11.0588 7.59006L11.05 7.50021V4.58615L4.58711 11.049L7.5002 11.05L7.59102 11.0588C7.79571 11.1008 7.94905 11.2822 7.94942 11.4992C7.94942 11.7478 7.74775 11.9494 7.49922 11.9494H3.5002C3.38087 11.9494 3.26622 11.902 3.18184 11.8176C3.09763 11.7332 3.05 11.6184 3.05 11.4992V7.50021L3.05977 7.40939C3.1019 7.20457 3.28292 7.05004 3.5002 7.05002C3.71763 7.05014 3.89974 7.20431 3.9416 7.40939L3.95039 7.50021V10.4143L10.4143 3.95041H7.5002C7.25181 3.9504 7.05023 3.74855 7.05 3.50021C7.05012 3.25179 7.25175 3.05003 7.5002 3.05002H11.5002L11.591 3.05881Z" fill="currentColor"/>
      </svg>
    </>
  );
}