← Back

Plus

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

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

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

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

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

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

@keyframes ai-plus-spin {
  from { transform: rotate(0); }
  to { transform: rotate(90deg); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="plus" d="M7.5 2.25C7.77614 2.25 8 2.47386 8 2.75V7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H8V12.25C8 12.5261 7.77614 12.75 7.5 12.75C7.22386 12.75 7 12.5261 7 12.25V8H2.75C2.47386 8 2.25 7.77614 2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H7V2.75C7 2.47386 7.22386 2.25 7.5 2.25Z" fill="currentColor"/>
      </svg>
    </>
  );
}