BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-extras/clock-icon

Clock Icon

shadcn-extras/clock-icon
FreeComponent

Animated clock icon with swing and shake effects.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/NayanDevLab/shadcn-extras/dev/public/c/clock-icon.json

Source

clock-icon.tsxraw.githubusercontent.com/NayanDevLab/shadcn-extras/dev/public/c/clock-icon.json
1'use client';
2
3import { motion, useAnimation } from 'motion/react';
4import { Clock } from 'lucide-react';
5import { cn } from '@/lib/utils';
6import { useEffect, useState } from 'react';
7
8interface ClockIconProps {
9 className?: string;
10 color?: string;
11 size?: number;
12 isAnimating?: boolean;
13 startOnHover?: boolean;
14 animationType?: 'swing' | 'shake';
15}
16
17export function ClockIcon({
18 className,
19 color = 'currentColor',
20 size = 24,
21 isAnimating = false,
22 startOnHover = true,
23 animationType = 'swing',
24}: ClockIconProps) {
25 const controls = useAnimation();
26 const [isHovered, setIsHovered] = useState(false);
27 const shouldAnimate = isAnimating || (startOnHover && isHovered);
28
29 useEffect(() => {
30 if (shouldAnimate) {
31 if (animationType === 'swing') {
32 controls.start({
33 rotate: [0, 15, -15, 10, -10, 0],
34 transition: {
35 duration: 1.5,
36 repeat: Infinity,
37 repeatType: 'loop',
38 ease: 'easeInOut',
39 repeatDelay: 0.5,
40 },
41 });
42 } else if (animationType === 'shake') {
43 controls.start({
44 x: [0, -2, 2, -2, 2, 0],
45 transition: {
46 duration: 0.2,
47 repeat: Infinity,
48 repeatType: 'loop',
49 ease: 'linear',
50 repeatDelay: 0.8,
51 },
52 });
53 }
54 } else {
55 controls.stop();
56 controls.set({ rotate: 0, x: 0 });
57 }
58 }, [shouldAnimate, animationType, controls]);
59
60 return (
61 <div
62 className={cn(
63 'relative flex cursor-pointer items-center justify-center select-none',
64 className
65 )}
66 onMouseEnter={() => setIsHovered(true)}
67 onMouseLeave={() => setIsHovered(false)}
68 >
69 <motion.div
70 animate={controls}
71 style={{ originY: animationType === 'swing' ? 0.2 : 0.5 }}
72 >
73 <Clock size={size} color={color} />
74 </motion.div>
75 </div>
76 );
77}

What it pulls in

npm packages

  • motion
  • lucide-react

Files it writes

  • \components\core\clock-icon.tsx

Facts

Registry
shadcn-extras
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

nayanrdeveloper.github.io NayanDevLab/shadcn-extras on GitHub Raw registry item This item as JSON

More from shadcn-extras

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Image Gridanimated-image-gridshadcn-extrasComponentsFreeno deps · 3 files
Blog Card Fourblog-card-fourshadcn-extrasComponentsFree1 dep
Blog Card Oneblog-card-oneshadcn-extrasComponentsFreeno deps
Blog Card Threeblog-card-threeshadcn-extrasComponentsFree1 dep
Blog Card Twoblog-card-twoshadcn-extrasComponentsFree1 dep
Bulb Iconbulb-iconshadcn-extrasComponentsFree2 deps
Chevron Stepschevron-stepsshadcn-extrasComponentsFreeno deps
Circular Gallerycircular-galleryshadcn-extrasComponentsFreeno deps · 3 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex