← Back

Border All

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

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

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

.ai-border-all-icon .side {
  stroke-dasharray: 12;
}

.ai-border-all-icon:not(.no-hover):hover .side {
  animation: ai-border-all-draw 700ms ease-out;
}

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

@keyframes ai-border-all-draw {
  from {
    stroke-dashoffset: 12;
  }
  to {
    stroke-dashoffset: 0;
  }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <g className="frame" stroke="currentColor" strokeWidth="1" strokeLinecap="round" stroke-dasharray="0 2">
          <path d="M1.5 7.5H13.5"/>
          <path d="M7.5 1.5V13.5"/>
        </g>
        <path className="side side-left" d="M1.5 13.5V1.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"/>
        <path className="side side-top" d="M1.5 1.5H13.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"/>
        <path className="side side-right" d="M13.5 1.5V13.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"/>
        <path className="side side-bottom" d="M13.5 13.5H1.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"/>
      </svg>
    </>
  );
}