← Back

Layout

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

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

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

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

.ai-layout-icon .left,
.ai-layout-icon .right {
  transform-origin: center;
}

.ai-layout-icon:not(.no-hover):hover .left {
  animation: ai-layout-merge-left 700ms ease-in-out;
}

.ai-layout-icon:not(.no-hover):hover .right {
  animation: ai-layout-merge-right 700ms ease-in-out;
}

@keyframes ai-layout-merge-left {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3.5px); }
}

@keyframes ai-layout-merge-right {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-3.5px); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <defs>
          <mask id="ai-layout-mask">
            <rect width="15" height="15" fill="white"/>
            <path className="left" d="M2.5 2C2.22386 2 2 2.22386 2 2.5V12.5C2 12.7761 2.22386 13 2.5 13H5V2H2.5Z" fill="black"/>
            <path className="middle" d="M6 13H9V2H6V13Z" fill="black"/>
            <path className="right" d="M10 13H12.5C12.7761 13 13 12.7761 13 12.5V2.5C13 2.22386 12.7761 2 12.5 2H10V13Z" fill="black"/>
          </mask>
        </defs>
        <path className="frame" d="M12.6533 1.00781C13.4097 1.08461 14 1.72334 14 2.5V12.5L13.9922 12.6533C13.9205 13.3593 13.3593 13.9205 12.6533 13.9922L12.5 14H2.5L2.34668 13.9922C1.64069 13.9205 1.07949 13.3593 1.00781 12.6533L1 12.5V2.5C1 1.72334 1.59028 1.08461 2.34668 1.00781L2.5 1H12.5L12.6533 1.00781Z" fill="currentColor" mask="url(#ai-layout-mask)"/>
      </svg>
    </>
  );
}