heroicons-animated
uiarchive-box-arrow-downsource: ok · refreshed
archive-box-arrow-down
Animated archive-box-arrow-down icon for React
npx shadcn add "https://www.heroicons-animated.com/r/archive-box-arrow-down.json"free
No selection tags yet — empty means no evidence, not lack of support.
Dependencies
Bundle weight · mediumanimationmotion
Files1 · source cached 10/7/2026, 11:47:46 PM
archive-box-arrow-down.tsx
"use client";
import type { Variants } from "motion/react";
import { motion, useAnimation } from "motion/react";
import type { HTMLAttributes } from "react";
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
import { cn } from "@/lib/utils";
export interface ArchiveBoxArrowDownIconHandle {
startAnimation: () => void;
stopAnimation: () => void;
}
interface ArchiveBoxArrowDownIconProps extends HTMLAttributes<HTMLDivElement> {
size?: number;
}
const LID_VARIANTS: Variants = {
normal: {
translateY: 0,
transition: {
duration: 0.2,
type: "spring",
stiffness: 200,
damping: 25,
},
},
animate: {
translateY: -1.5,
transition: {
duration: 0.2,
type: "spring",
stiffness: 200,
damping: 25,
},
},
};
const PATH_VARIANTS: Variants = {
normal: {
translateY: 0,
transition: {
duration: 0.2,
type: "spring",
stiffness: 200,
damping: 25,
},
},
animate: {
translateY: 1,
transition: {
duration: 0.2,
type: "spring",
stiffness: 200,
damping: 25,
},
},
};
const ARROW_VARIANTS: Variants = {
normal: {
translateY: 0,
transition: {
duration: 0.2,
type: "spring",
stiffness: 200,
damping: 25,
},
},
animate: {
translateY: 2,
transition: {
duration: 0.2,
type: "spring",
stiffness: 200,
damping: 25,
},
},
};
const ArchiveBoxArrowDownIcon = forwardRef<
ArchiveBoxArrowDownIconHandle,
ArchiveBoxArrowDownIconProps
>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
const controls = useAnimation();
const isControlledRef = useRef(false);
useImperativeHandle(ref, () => {
isControlledRef.current = true;
return {
startAnimation: () => controls.start("animate"),
stopAnimation: () => controls.start("normal"),
};
});
const handleMouseEnter = useCallback(
(e: React.MouseEvent<HTMLDivElement>) => {
if (isControlledRef.current) {
onMouseEnter?.(e);
} else {
controls.start("animate");
}
},
[controls, onMouseEnter]
);
const handleMouseLeave = useCallback(
(e: React.MouseEvent<HTMLDivElement>) => {
if (isControlledRef.current) {
onMouseLeave?.(e);
} else {
controls.start("normal");
}
},
[controls, onMouseLeave]
);
return (
<div
className={cn(className)}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
{...props}
>
<svg
fill="none"
height={size}
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
viewBox="0 0 24 24"
width={size}
xmlns="http://www.w3.org/2000/svg"
>
<motion.path
animate={controls}
d="M19.6246 18.1321C19.5546 19.3214 18.5698 20.25 17.3785 20.25H6.62154C5.43022 20.25 4.44538 19.3214 4.37542 18.1321"
initial="normal"
variants={PATH_VARIANTS}
/>
<motion.path
animate={controls}
d="M20.25 7.5L19.6246 18.1321"
initial="normal"
variants={PATH_VARIANTS}
/>
<motion.path
animate={controls}
d="M3.75 7.5L4.37542 18.1321"
initial="normal"
variants={PATH_VARIANTS}
/>
<motion.path
animate={controls}
d="M12 10.5V17.25"
initial="normal"
variants={ARROW_VARIANTS}
/>
<motion.path
animate={controls}
d="M12 17.25L9 14.25"
initial="normal"
variants={ARROW_VARIANTS}
/>
<motion.path
animate={controls}
d="M12 17.25L15 14.25"
initial="normal"
variants={ARROW_VARIANTS}
/>
<motion.path
animate={controls}
d="M3.375 7.5H20.625C21.2463 7.5 21.75 6.99632 21.75 6.375V4.875C21.75 4.25368 21.2463 3.75 20.625 3.75H3.375C2.75368 3.75 2.25 4.25368 2.25 4.875V6.375C2.25 6.99632 2.75368 7.5 3.375 7.5Z"
initial="normal"
variants={LID_VARIANTS}
/>
</svg>
</div>
);
});
ArchiveBoxArrowDownIcon.displayName = "ArchiveBoxArrowDownIcon";
export { ArchiveBoxArrowDownIcon };