clock-01

An animated clock icon from the hugeicons-animated registry whose hour and minute hands spin two and one full circuits respectively on hover, then settle back to the resting shape. It is a React component built on motion/react with an imperative handle for programmatic control.

clock-01
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @hugeicons-animated/clock-01

Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { Clock01Icon } from '@/components/icons/clock-01';export default function Example() {  return <Clock01Icon size={28} className="text-foreground" />;}
  • Showing time, schedules, timers, or deadlines in a UI where a hover-triggered playful animation adds feedback.
  • Decorating a clock or time-tracking button, menu item, or navigation entry with a lightweight animated icon.
  • Triggering the spin programmatically (for example when a timer starts) by holding a ref and calling startAnimation.
  • Replacing a static clock glyph in a design system that already uses motion/react.

Examples

Hover-triggered clock in a button

Uses the icon inside a button so hovering the button's icon area plays the spin animation.

hover-triggered-clock-in-a-button.tsx
import { Clock01Icon } from '@/components/icons/clock-01';export function ScheduleButton() {  return (    <button type="button" className="inline-flex items-center gap-2 rounded-md border px-3 py-2">      <Clock01Icon size={20} className="text-muted-foreground" />      Schedule    </button>  );}

Programmatic start via ref

Holds a ref to the icon and calls startAnimation when a timer begins.

programmatic-start-via-ref.tsx
'use client';import { useRef } from 'react';import { Clock01Icon, type Clock01IconHandle } from '@/components/icons/clock-01';export function TimerStatus() {  const iconRef = useRef<Clock01IconHandle>(null);  return (    <div onClick={() => iconRef.current?.startAnimation()}>      <Clock01Icon ref={iconRef} size={24} />    </div>  );}

Icon with a custom mouse handler

Passes onMouseEnter through so analytics or side effects run alongside the animation.

icon-with-a-custom-mouse-handler.tsx
import { Clock01Icon } from '@/components/icons/clock-01';export function HoverTracked() {  return (    <Clock01Icon      size={32}      className="text-blue-600"      onMouseEnter={() => console.log('clock hovered')}    />  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels.
classNamestring—Class name applied to the outer wrapper div (passed through cn).
onMouseEnterMouseEventHandler<HTMLDivElement>—Called on mouse enter of the wrapper div before the animation starts.
onMouseLeaveMouseEventHandler<HTMLDivElement>—Called on mouse leave of the wrapper div; stops the animation only when loops is enabled (it is false here).
refRef<Clock01IconHandle>—Forwarded ref exposing startAnimation and stopAnimation. When a ref is attached, hover no longer triggers the animation automatically.
...propsHTMLAttributes<HTMLDivElement>—Any other standard div attributes spread onto the wrapper div.

Accessibility

  • The icon renders as a decorative SVG with no role, title, or aria-label; add aria-label or aria-hidden on the wrapper when it conveys meaning or is purely decorative.
  • Animation is skipped when the user prefers reduced motion (useReducedMotion), so the icon stays static for those users.
  • Because the wrapper is a div, provide keyboard-accessible interaction through a surrounding button or link rather than relying on hover alone.
  • The icon uses currentColor, so it keeps the text color contrast of its container; ensure that color meets WCAG contrast requirements.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "clock-01" component (hugeicons-animated/clock-01) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/clock-012. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, onMouseEnter, onMouseLeave, ref, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { Clock01Icon } from '@/components/icons/clock-01';export default function Example() {  return <Clock01Icon size={28} className="text-foreground" />;}```

Files & dependencies

  • icons/clock-01.tsx
  • lib/use-icon-animation.ts
dependenciesmotion

Looks similar, elsewhere