alarm-clock-plus
lucide-animated-pqoqubbw/alarm-clock-plusFreeComponent
lucide-animated publishes no description for this item.
Install it
npx shadcn@latest add https://lucide-animated.com/r/alarm-clock-plus.jsonSource
1"use client";23import { motion, useAnimation, type Variants } from "motion/react";4import type { HTMLAttributes } from "react";5import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";6import { cn } from "@/lib/utils";78export interface AlarmClockPlusIconHandle {9 startAnimation: () => void;10 stopAnimation: () => void;11}1213interface AlarmClockPlusIconProps extends HTMLAttributes<HTMLDivElement> {14 size?: number;15}1617const PATH_VARIANTS: Variants = {18 normal: {19 y: 0,20 x: 0,21 transition: {22 duration: 0.2,23 type: "spring",24 stiffness: 200,25 damping: 25,26 },27 },28 animate: {29 y: -1.5,30 x: [-1, 1, -1, 1, -1, 0],31 transition: {32 y: {33 duration: 0.2,34 type: "spring",35 stiffness: 200,36 damping: 25,37 },38 x: {39 duration: 0.3,40 repeat: Number.POSITIVE_INFINITY,41 ease: "linear",42 },43 },44 },45};4647const SECONDARY_PATH_VARIANTS: Variants = {48 normal: {49 y: 0,50 x: 0,51 transition: {52 duration: 0.2,53 type: "spring",54 stiffness: 200,55 damping: 25,56 },57 },58 animate: {59 y: -2.5,60 x: [-2, 2, -2, 2, -2, 0],61 transition: {62 y: {63 duration: 0.2,64 type: "spring",65 stiffness: 200,66 damping: 25,67 },68 x: {69 duration: 0.3,70 repeat: Number.POSITIVE_INFINITY,71 ease: "linear",72 },73 },74 },75};7677const AlarmClockPlusIcon = forwardRef<78 AlarmClockPlusIconHandle,79 AlarmClockPlusIconProps80>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {81 const controls = useAnimation();82 const isControlledRef = useRef(false);8384 useImperativeHandle(ref, () => {85 isControlledRef.current = true;86 return {87 startAnimation: () => controls.start("animate"),88 stopAnimation: () => controls.start("normal"),89 };90 });9192 const handleMouseEnter = useCallback(93 (e: React.MouseEvent<HTMLDivElement>) => {94 if (isControlledRef.current) {95 onMouseEnter?.(e);96 } else {97 controls.start("animate");98 }99 },100 [controls, onMouseEnter]101 );102103 const handleMouseLeave = useCallback(104 (e: React.MouseEvent<HTMLDivElement>) => {105 if (isControlledRef.current) {106 onMouseLeave?.(e);107 } else {108 controls.start("normal");109 }110 },111 [controls, onMouseLeave]112 );113114 return (115 <div116 className={cn(className)}117 onMouseEnter={handleMouseEnter}118// … 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 |
