align-right
lucide-animated-icons/align-rightFreeComponent
lucide-animated publishes no description for this item.
Install it
npx shadcn@latest add https://icons.pqoqubbw.dev/r/align-right.jsonSource
1"use client";23import type { Transition } 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 AlignRightIconHandle {11 startAnimation: () => void;12 stopAnimation: () => void;13}1415interface AlignRightIconProps extends HTMLAttributes<HTMLDivElement> {16 size?: number;17}1819const DEFAULT_TRANSITION: Transition = {20 type: "spring",21 stiffness: 150,22 damping: 15,23 mass: 0.3,24};2526const AlignRightIcon = forwardRef<AlignRightIconHandle, AlignRightIconProps>(27 ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {28 const controls = useAnimation();29 const isControlledRef = useRef(false);3031 useImperativeHandle(ref, () => {32 isControlledRef.current = true;3334 return {35 startAnimation: () => controls.start("animate"),36 stopAnimation: () => controls.start("normal"),37 };38 });3940 const handleMouseEnter = useCallback(41 (e: React.MouseEvent<HTMLDivElement>) => {42 if (isControlledRef.current) {43 onMouseEnter?.(e);44 } else {45 controls.start("animate");46 }47 },48 [controls, onMouseEnter]49 );5051 const handleMouseLeave = useCallback(52 (e: React.MouseEvent<HTMLDivElement>) => {53 if (isControlledRef.current) {54 onMouseLeave?.(e);55 } else {56 controls.start("normal");57 }58 },59 [controls, onMouseLeave]60 );6162 return (63 <div64 className={cn(className)}65 onMouseEnter={handleMouseEnter}66 onMouseLeave={handleMouseLeave}67 {...props}68 >69 <svg70 fill="none"71 height={size}72 stroke="currentColor"73 strokeLinecap="round"74 strokeLinejoin="round"75 strokeWidth="2"76 viewBox="0 0 24 24"77 width={size}78 xmlns="http://www.w3.org/2000/svg"79 >80 <motion.line81 animate={controls}82 transition={DEFAULT_TRANSITION}83 variants={{84 normal: { x1: 3 },85 animate: { x1: 3 },86 }}87 x1="3"88 x2="21"89 y1="6"90 y2="6"91 />9293 <motion.line94 animate={controls}95 transition={DEFAULT_TRANSITION}96 variants={{97 normal: { x1: 9 },98// … truncated
What it pulls in
npm packages
Files it writes
More from lucide-animated
All 466 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 |
