arrow-big-right-dash
lucide-animated-pqoqubbw/arrow-big-right-dashFreeComponent
lucide-animated publishes no description for this item.
Install it
npx shadcn@latest add https://lucide-animated.com/r/arrow-big-right-dash.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 ArrowBigRightDashIconHandle {11 startAnimation: () => void;12 stopAnimation: () => void;13}1415interface ArrowBigRightDashIconProps extends HTMLAttributes<HTMLDivElement> {16 size?: number;17}1819const DASH_VARIANTS: Variants = {20 normal: { translateX: 0 },21 animate: {22 translateX: [0, 1, 0],23 transition: {24 duration: 0.4,25 },26 },27};2829const ARROW_VARIANTS: Variants = {30 normal: { translateX: 0 },31 animate: {32 translateX: [0, 3, 0],33 transition: {34 duration: 0.4,35 },36 },37};3839const ArrowBigRightDashIcon = forwardRef<40 ArrowBigRightDashIconHandle,41 ArrowBigRightDashIconProps42>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {43 const controls = useAnimation();44 const isControlledRef = useRef(false);4546 useImperativeHandle(ref, () => {47 isControlledRef.current = true;48 return {49 startAnimation: () => controls.start("animate"),50 stopAnimation: () => controls.start("normal"),51 };52 });5354 const handleMouseEnter = useCallback(55 (e: React.MouseEvent<HTMLDivElement>) => {56 if (isControlledRef.current) {57 onMouseEnter?.(e);58 } else {59 controls.start("animate");60 }61 },62 [controls, onMouseEnter]63 );6465 const handleMouseLeave = useCallback(66 (e: React.MouseEvent<HTMLDivElement>) => {67 if (isControlledRef.current) {68 onMouseLeave?.(e);69 } else {70 controls.start("normal");71 }72 },73 [controls, onMouseLeave]74 );7576 return (77 <div78 className={cn(className)}79 onMouseEnter={handleMouseEnter}80 onMouseLeave={handleMouseLeave}81 {...props}82 >83 <svg84 fill="none"85 height={size}86 stroke="currentColor"87 strokeLinecap="round"88 strokeLinejoin="round"89 strokeWidth="2"90 viewBox="0 0 24 24"91 width={size}92 xmlns="http://www.w3.org/2000/svg"93 >94 <motion.path animate={controls} d="M5 9v6" variants={DASH_VARIANTS} />95 <motion.path96 animate={controls}97 d="M9 9h3V5l7 7-7 7v-4H9V9z"98 variants={ARROW_VARIANTS}99 />100 </svg>101 </div>102 );103});104105ArrowBigRightDashIcon.displayName = "ArrowBigRightDashIcon";106107// … truncated
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 |
