arrow-big-up
lucide-animated-pqoqubbw/arrow-big-upFreeComponent
lucide-animated publishes no description for this item.
Install it
npx shadcn@latest add https://lucide-animated.com/r/arrow-big-up.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 ArrowBigUpIconHandle {11 startAnimation: () => void;12 stopAnimation: () => void;13}1415interface ArrowBigUpIconProps extends HTMLAttributes<HTMLDivElement> {16 size?: number;17}1819const PATH_VARIANTS: Variants = {20 normal: { d: "M9 18v-6H5l7-7 7 7h-4v6H9z", translateY: 0 },21 animate: {22 d: "M9 18v-6H5l7-7 7 7h-4v6H9z",23 translateY: [0, -3, 0],24 transition: {25 duration: 0.4,26 },27 },28};2930const ArrowBigUpIcon = forwardRef<ArrowBigUpIconHandle, ArrowBigUpIconProps>(31 ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {32 const controls = useAnimation();33 const isControlledRef = useRef(false);3435 useImperativeHandle(ref, () => {36 isControlledRef.current = true;37 return {38 startAnimation: () => controls.start("animate"),39 stopAnimation: () => controls.start("normal"),40 };41 });4243 const handleMouseEnter = useCallback(44 (e: React.MouseEvent<HTMLDivElement>) => {45 if (isControlledRef.current) {46 onMouseEnter?.(e);47 } else {48 controls.start("animate");49 }50 },51 [controls, onMouseEnter]52 );5354 const handleMouseLeave = useCallback(55 (e: React.MouseEvent<HTMLDivElement>) => {56 if (isControlledRef.current) {57 onMouseLeave?.(e);58 } else {59 controls.start("normal");60 }61 },62 [controls, onMouseLeave]63 );6465 return (66 <div67 className={cn(className)}68 onMouseEnter={handleMouseEnter}69 onMouseLeave={handleMouseLeave}70 {...props}71 >72 <svg73 fill="none"74 height={size}75 stroke="currentColor"76 strokeLinecap="round"77 strokeLinejoin="round"78 strokeWidth="2"79 viewBox="0 0 24 24"80 width={size}81 xmlns="http://www.w3.org/2000/svg"82 >83 <motion.path84 animate={controls}85 d="M9 18v-6H5l7-7 7 7h-4v6H9z"86 variants={PATH_VARIANTS}87 />88 </svg>89 </div>90 );91 }92);9394ArrowBigUpIcon.displayName = "ArrowBigUpIcon";9596export { ArrowBigUpIcon };
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 |
