← Back

Home

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

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

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

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

.ai-home-icon .roof {
  transform-origin: center;
}

.ai-home-icon:not(.no-hover):hover .roof {
  animation: ai-home-lift 700ms ease-in-out;
}

@keyframes ai-home-lift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.8px); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="body" d="M1.99984 6.90076H12.9998V12.5004C12.9997 12.7764 12.7759 13.0004 12.4998 13.0004H2.49984C2.22393 13.0002 1.99994 12.7763 1.99984 12.5004V6.90076ZM2.99984 6.90076V12.0004H5.99984V8.50037L6.00961 8.39978C6.05611 8.17193 6.25829 8.00054 6.49984 8.00037H9.49984L9.60043 8.01013C9.82839 8.05666 9.99984 8.25865 9.99984 8.50037V12.0004H11.9998V6.90076H2.99984ZM6.99984 12.0004H8.99984V9.00037H6.99984V12.0004Z" fill="currentColor"/>
        <path className="roof" d="M7.17269 0.146853C7.40386 -0.0038436 7.7164 0.021395 7.92074 0.222048L14.6707 6.8617L14.7479 6.95545C14.9037 7.18704 14.8809 7.50355 14.6776 7.71033C14.4742 7.91711 14.1578 7.94537 13.9237 7.79334L13.8289 7.71716L12.9998 6.90076H1.99984L1.17074 7.71716C0.934507 7.94955 0.554487 7.94656 0.322105 7.71033C0.0902207 7.47406 0.0928771 7.09391 0.328941 6.8617L7.07894 0.222048L7.17269 0.146853ZM2.99984 6.90076L11.9998 6.90076L7.49984 1.4906L2.99984 6.90076Z" fill="currentColor"/>
      </svg>
    </>
  );
}