arrow-big-down
lucide-animated-pqoqubbw/arrow-big-downFreeComponent
lucide-animated publishes no description for this item.
Install it
npx shadcn@latest add https://lucide-animated.com/r/arrow-big-down.jsonSource
1"use client";23import type { Variants } from "motion/react";4import { motion, useAnimation } from "motion/react";5import type { HTMLAttributes } from "react";6import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";78import { cn } from "@/lib/utils";910export interface ArrowBigDownIconHandle {11 startAnimation: () => void;12 stopAnimation: () => void;13}1415interface ArrowBigDownIconProps extends HTMLAttributes<HTMLDivElement> {16 size?: number;17}1819const PATH_VARIANTS: Variants = {20 normal: { d: "M15 6v6h4l-7 7-7-7h4V6h6z", translateY: 0 },21 animate: {22 d: "M15 6v6h4l-7 7-7-7h4V6h6z",23 translateY: [0, +3, 0],24 transition: {25 duration: 0.4,26 },27 },28};2930const ArrowBigDownIcon = forwardRef<31 ArrowBigDownIconHandle,32 ArrowBigDownIconProps33>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {34 const controls = useAnimation();35 const isControlledRef = useRef(false);3637 useImperativeHandle(ref, () => {38 isControlledRef.current = true;39 return {40 startAnimation: () => controls.start("animate"),41 stopAnimation: () => controls.start("normal"),42 };43 });4445 const handleMouseEnter = useCallback(46 (e: React.MouseEvent<HTMLDivElement>) => {47 if (isControlledRef.current) {48 onMouseEnter?.(e);49 } else {50 controls.start("animate");51 }52 },53 [controls, onMouseEnter]54 );5556 const handleMouseLeave = useCallback(57 (e: React.MouseEvent<HTMLDivElement>) => {58 if (isControlledRef.current) {59 onMouseLeave?.(e);60 } else {61 controls.start("normal");62 }63 },64 [controls, onMouseLeave]65 );6667 return (68 <div69 className={cn(className)}70 onMouseEnter={handleMouseEnter}71 onMouseLeave={handleMouseLeave}72 {...props}73 >74 <svg75 fill="none"76 height={size}77 stroke="currentColor"78 strokeLinecap="round"79 strokeLinejoin="round"80 strokeWidth="2"81 viewBox="0 0 24 24"82 width={size}83 xmlns="http://www.w3.org/2000/svg"84 >85 <motion.path86 animate={controls}87 d="M15 6v6h4l-7 7-7-7h4V6h6z"88 variants={PATH_VARIANTS}89 />90 </svg>91 </div>92 );93});9495ArrowBigDownIcon.displayName = "ArrowBigDownIcon";9697export { ArrowBigDownIcon };
What it pulls in
npm packages
Files it writes
More from lucide-animated
All 464 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| a-arrow-downa-arrow-down | lucide-animated | Components | Free | 1 dep | |
| a-arrow-upa-arrow-up | lucide-animated | Components | Free | 1 dep | |
| accessibilityaccessibility | lucide-animated | Components | Free | 1 dep | |
| activityactivity | lucide-animated | Components | Free | 1 dep | |
| air-ventair-vent | lucide-animated | Components | Free | 1 dep | |
| airplaneairplane | lucide-animated | Components | Free | 1 dep | |
| airplayairplay | lucide-animated | Components | Free | 1 dep | |
| alarm-clockalarm-clock | lucide-animated | Components | Free | 1 dep |
