← Back

Dimensions

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

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

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

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

.ai-dimensions-icon .arrow-h,
.ai-dimensions-icon .arrow-v {
  transform-origin: center;
}

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

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

@keyframes ai-dimensions-h {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.12); }
}

@keyframes ai-dimensions-v {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.12); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <rect className="frame" x="1" y="4" width="10" height="10" rx="0.5" stroke="currentColor" strokeWidth="1"/>
        <path className="arrow-h" d="M1 1.5H10M2.5 0.5L1 1.5L2.5 2.5M8.5 0.5L10 1.5L8.5 2.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round"/>
        <path className="arrow-v" d="M13.5 4V14M12.5 5.5L13.5 4L14.5 5.5M12.5 12.5L13.5 14L14.5 12.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round"/>
      </svg>
    </>
  );
}