← Back

Crosshair 2

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

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

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

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

.ai-crosshair-2-icon .tick { transform-origin: center; }

.ai-crosshair-2-icon:not(.no-hover):hover .tick-top { animation: ai-crosshair-2-top 700ms ease-in-out; }
.ai-crosshair-2-icon:not(.no-hover):hover .tick-right { animation: ai-crosshair-2-right 700ms ease-in-out; }
.ai-crosshair-2-icon:not(.no-hover):hover .tick-bottom { animation: ai-crosshair-2-bottom 700ms ease-in-out; }
.ai-crosshair-2-icon:not(.no-hover):hover .tick-left { animation: ai-crosshair-2-left 700ms ease-in-out; }

@keyframes ai-crosshair-2-top { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.25px); } }
@keyframes ai-crosshair-2-right { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(1.25px); } }
@keyframes ai-crosshair-2-bottom { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(1.25px); } }
@keyframes ai-crosshair-2-left { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-1.25px); } }
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <circle className="ring" cx="7.5" cy="7.5" r="6.5" stroke="currentColor" strokeWidth="1"/>
        <path className="tick tick-top" d="M7.5 1V5.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round"/>
        <path className="tick tick-right" d="M14 7.5H9.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round"/>
        <path className="tick tick-bottom" d="M7.5 14V9.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round"/>
        <path className="tick tick-left" d="M1 7.5H5.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round"/>
      </svg>
    </>
  );
}