← Back

Pin Top

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

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

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

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

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

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

@keyframes ai-pin-top-push {
  0%, 50%, 100% { transform: translateY(0); }
  25%, 75% { transform: translateY(-1px); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="arrow" d="M7.2522 4.12427C7.40205 4.02515 7.59844 4.02515 7.74829 4.12427L7.8186 4.18188L11.0686 7.43188C11.2441 7.60764 11.2443 7.89295 11.0686 8.0686C10.8929 8.24416 10.6076 8.24405 10.4319 8.0686L7.95044 5.58716V13.5002C7.95032 13.7486 7.74862 13.9503 7.50024 13.9504C7.25179 13.9504 7.05017 13.7487 7.05005 13.5002V5.58716L4.5686 8.0686L4.49829 8.12622C4.3237 8.24163 4.08572 8.22219 3.93188 8.0686C3.77809 7.91481 3.75888 7.67687 3.87427 7.5022L3.93188 7.43188L7.18188 4.18188L7.2522 4.12427Z" fill="currentColor"/>
        <path className="bar" d="M13.5002 1.05005C13.7487 1.05015 13.9504 1.25178 13.9504 1.50024C13.9503 1.74862 13.7486 1.95033 13.5002 1.95044H1.50024C1.25178 1.95044 1.05015 1.74868 1.05005 1.50024C1.05005 1.25172 1.25172 1.05005 1.50024 1.05005H13.5002Z" fill="currentColor"/>
      </svg>
    </>
  );
}