Archive
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 archive --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 ArchiveIcon({ disableHover, className }: Props) {
const classes = [
"ai-archive-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-archive-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-archive-icon * {
transform-box: fill-box;
transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 220ms ease;
}
.ai-archive-icon .lid {
transform-origin: center bottom;
}
.ai-archive-icon .box {
transform-origin: center bottom;
}
.ai-archive-icon .handle {
transform-origin: center;
}
.ai-archive-icon:not(.no-hover):hover .lid {
animation: ai-archive-motion-1 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-archive-icon:not(.no-hover):hover .box {
animation: ai-archive-motion-2 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-archive-icon:not(.no-hover):hover .handle {
animation: ai-archive-motion-3 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
animation-delay: 60ms;
}
.ai-archive-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
@keyframes ai-archive-motion-1 {
0%,
100% {
transform: none;
}
52% {
transform: translateY(-0.8px) rotate(-3deg);
}
}
@keyframes ai-archive-motion-2 {
0%,
100% {
transform: none;
}
52% {
transform: translateY(0.35px);
}
}
@keyframes ai-archive-motion-3 {
0%,
100% {
transform: none;
}
52% {
transform: scaleX(0.72);
}
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<path className="lid" d="M2.6 1.6H12.4L13.6 4.5H1.4L2.6 1.6Z" stroke="currentColor" strokeWidth="1" strokeLinejoin="round"/>
<rect className="box" x="1.5" y="4.5" width="12" height="9" rx="0.8" stroke="currentColor" strokeWidth="1"/>
<path className="handle" d="M5.4 7.3H9.6" stroke="currentColor" strokeWidth="1" strokeLinecap="round"/>
</svg>
</>
);
}