← Back

Stretch Horizontally

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

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

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

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

.ai-stretch-horizontally-icon .shape {
  transform-box: view-box;
  transform-origin: 7.5px 7.5px;
}

.ai-stretch-horizontally-icon:not(.no-hover):hover .shape {
  animation: ai-stretch-horizontally-stretch 700ms ease-in-out;
}

@keyframes ai-stretch-horizontally-stretch {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.1); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="shape" d="M0.999992 8.99993L0.999991 13.4999C0.999991 13.776 0.776135 13.9999 0.499995 13.9999C0.223855 13.9999 -5.58458e-07 13.776 -5.46388e-07 13.4999L-2.18555e-08 1.49999C1.89755e-06 1.22385 0.223857 0.999991 0.499996 0.999991C0.776135 0.999991 0.99999 1.22385 0.999992 1.49999L0.999992 5.99995L13.9999 5.99995L13.9999 1.49999C13.9999 1.22385 14.2237 0.999992 14.4999 0.999992C14.776 0.999992 14.9999 1.22385 14.9999 1.49999L14.9999 13.4999C14.9999 13.776 14.776 13.9999 14.4999 13.9999C14.2237 13.9999 13.9999 13.776 13.9999 13.4999L13.9999 8.99993L0.999992 8.99993Z" fill="currentColor"/>
      </svg>
    </>
  );
}