← Back

Minimize

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

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

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

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

.ai-minimize-icon .arrow-bl,
.ai-minimize-icon .arrow-tr {
  transform-origin: center;
}

.ai-minimize-icon:not(.no-hover):hover .arrow-bl {
  animation: ai-minimize-pull-bl 700ms ease-in-out;
}

.ai-minimize-icon:not(.no-hover):hover .arrow-tr {
  animation: ai-minimize-pull-tr 700ms ease-in-out;
}

@keyframes ai-minimize-pull-bl {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(1.5px, -1.5px); }
}

@keyframes ai-minimize-pull-tr {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-1.5px, 1.5px); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="arrow-bl" d="M6.50021 8.0502C6.61922 8.05031 6.73334 8.09799 6.8176 8.18204C6.90185 8.26641 6.95041 8.38115 6.95041 8.5004V12.5004C6.9502 12.7486 6.74841 12.9494 6.50021 12.9496C6.25178 12.9495 6.05002 12.7479 6.05002 12.4994V9.58536L2.3176 13.3178C2.14195 13.4933 1.85758 13.4942 1.68185 13.3188C1.50615 13.1431 1.50621 12.8578 1.68185 12.682L5.4133 8.95059L2.50021 8.94962C2.25182 8.94962 2.05121 8.74874 2.05099 8.5004C2.05099 8.25187 2.25169 8.0502 2.50021 8.0502H6.50021Z" fill="currentColor"/>
        <path className="arrow-tr" d="M12.6819 1.68204C12.8576 1.50651 13.1429 1.50637 13.3186 1.68204C13.4939 1.85767 13.4938 2.14211 13.3186 2.31778L9.58615 6.0502H12.5002C12.7486 6.05042 12.9504 6.252 12.9504 6.5004C12.9502 6.74861 12.7484 6.95038 12.5002 6.95059H8.50021L8.40939 6.94083C8.20459 6.8988 8.05021 6.71759 8.05002 6.5004V2.5004C8.05015 2.25199 8.25178 2.05022 8.50021 2.0502C8.74863 2.05032 8.9494 2.25196 8.94943 2.5004V5.41446L12.6819 1.68204Z" fill="currentColor"/>
      </svg>
    </>
  );
}