← Back

Component 1

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

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

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

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

.ai-component-1-icon .diamond {
  transform-origin: center;
}

.ai-component-1-icon:not(.no-hover):hover .diamond-top {
  animation: ai-component-1-top 700ms ease-in-out;
}

.ai-component-1-icon:not(.no-hover):hover .diamond-bottom {
  animation: ai-component-1-bottom 700ms ease-in-out;
}

.ai-component-1-icon:not(.no-hover):hover .diamond-left {
  animation: ai-component-1-left 700ms ease-in-out;
}

.ai-component-1-icon:not(.no-hover):hover .diamond-right {
  animation: ai-component-1-right 700ms ease-in-out;
}

@keyframes ai-component-1-top {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}
@keyframes ai-component-1-bottom {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1px); }
}
@keyframes ai-component-1-left {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-1px); }
}
@keyframes ai-component-1-right {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(1px); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="diamond diamond-top" d="M7.5 1L10 3.5L7.5 6L5 3.5Z" stroke="currentColor" strokeWidth="1" strokeLinejoin="round"/>
        <path className="diamond diamond-bottom" d="M7.5 9L10 11.5L7.5 14L5 11.5Z" stroke="currentColor" strokeWidth="1" strokeLinejoin="round"/>
        <path className="diamond diamond-left" d="M1 7.5L3.5 5L6 7.5L3.5 10Z" stroke="currentColor" strokeWidth="1" strokeLinejoin="round"/>
        <path className="diamond diamond-right" d="M9 7.5L11.5 5L14 7.5L11.5 10Z" stroke="currentColor" strokeWidth="1" strokeLinejoin="round"/>
      </svg>
    </>
  );
}