← Back

Stack

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

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

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

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

.ai-stack-icon .top {
  transform-origin: center;
}

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

@keyframes ai-stack-merge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="bottom" d="M12.8378 8.27743C13.0576 8.20179 13.3077 8.28825 13.4306 8.49618C13.5531 8.70407 13.508 8.96425 13.3358 9.12021L13.2538 9.18075L7.75381 12.4308C7.59714 12.5231 7.40267 12.5231 7.246 12.4308L1.746 9.18075L1.66397 9.12021C1.49183 8.96425 1.44671 8.70405 1.56924 8.49618C1.69212 8.28825 1.94221 8.20183 2.16202 8.27743L2.25381 8.31942L7.49991 11.419L12.746 8.31942L12.8378 8.27743Z" fill="currentColor"/>
        <path className="top" fillRule="evenodd" d="M7.30557 1.78915C7.45005 1.72821 7.6165 1.73849 7.75381 1.81942L13.2538 5.06942C13.4061 5.15938 13.4999 5.32326 13.4999 5.50009C13.4999 5.67692 13.4061 5.8408 13.2538 5.93075L7.75381 9.18075C7.59714 9.2731 7.40267 9.27312 7.246 9.18075L1.746 5.93075C1.5938 5.84079 1.49991 5.67689 1.49991 5.50009C1.49991 5.32328 1.5938 5.15939 1.746 5.06942L7.246 1.81942L7.30557 1.78915ZM2.98233 5.50009L7.49991 8.16903L12.0165 5.50009L7.49991 2.83017L2.98233 5.50009Z" fill="currentColor"/>
      </svg>
    </>
  );
}