Open In New Window
Install
npm install @svg-animated-icons/reactCLI
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| Flag | Description |
|---|---|
--dest <dir> | Destination directory (default: components/animated-icons) |
Or copy the component with the CLI
CLI
npx @svg-animated-icons/cli add open-in-new-window --reactCode
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 OpenInNewWindowIcon({ disableHover, className }: Props) {
const classes = [
"ai-open-in-new-window-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-open-in-new-window-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-open-in-new-window-icon * {
transform-box: fill-box;
}
.ai-open-in-new-window-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
.ai-open-in-new-window-icon .arrow {
transform-origin: center;
}
.ai-open-in-new-window-icon:not(.no-hover):hover .arrow {
animation: ai-open-in-new-window-shoot 700ms ease-in-out;
}
@keyframes ai-open-in-new-window-shoot {
0%, 100% { transform: translate(0, 0); }
50% { transform: translate(-1.2px, 1.2px); }
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<path className="arrow" d="M8.5 6C8.53267 6 8.56549 6.00242 8.59766 6.00879C8.64875 6.01889 8.69602 6.03909 8.74023 6.06348C8.78055 6.08569 8.81933 6.1123 8.85352 6.14648C8.88737 6.18034 8.91343 6.21891 8.93555 6.25879C8.96008 6.30299 8.98 6.35024 8.99023 6.40137C8.99675 6.43389 9 6.46695 9 6.5V9.5C9 9.77614 8.77614 10 8.5 10C8.22386 10 8 9.77614 8 9.5V7.70703L2.85352 12.8535C2.65825 13.0488 2.34175 13.0488 2.14648 12.8535C1.95122 12.6583 1.95122 12.3417 2.14648 12.1465L7.29297 7H5.5C5.22386 7 5 6.77614 5 6.5C5 6.22386 5.22386 6 5.5 6H8.5Z" fill="currentColor"/>
<path className="window" d="M12 2C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H8.5C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12H12V3H3V6.5C3 6.77614 2.77614 7 2.5 7C2.22386 7 2 6.77614 2 6.5V3C2 2.44772 2.44772 2 3 2H12Z" fill="currentColor"/>
</svg>
</>
);
}