← Back

Crop

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

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

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

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

.ai-crop-icon .bracket-tl,
.ai-crop-icon .bracket-br {
  transform-origin: center;
}

.ai-crop-icon:not(.no-hover):hover .bracket-tl {
  animation: ai-crop-tl 700ms ease-in-out;
}

.ai-crop-icon:not(.no-hover):hover .bracket-br {
  animation: ai-crop-br 700ms ease-in-out;
}

@keyframes ai-crop-tl { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-1.25px, -1.25px); } }
@keyframes ai-crop-br { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(1.25px, 1.25px); } }
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <rect className="frame" x="3.5" y="3.5" width="8" height="8" stroke="currentColor" strokeWidth="1"/>
        <path className="bracket-tl" d="M0.5 3.5H3.5V0.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round"/>
        <path className="bracket-br" d="M11.5 14.5V11.5H14.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round"/>
      </svg>
    </>
  );
}