copy-01

copy-01 is an animated Copy icon from the hugeicons-animated registry. A front rounded-square sheet slides and scales over a rear panel on hover, then returns, and the install adds a shared useIconAnimation hook.

copy-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/copy-01

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

Usage

usage.tsx
import { Copy01Icon } from '@/components/ui/copy-01';export default function Example() {  return <Copy01Icon size={28} className="text-foreground" />;}
  • Copy-to-clipboard buttons or 'copy link' actions where a playful micro-interaction on hover helps users recognize the action
  • Toolbars, menus, or table rows that need a single-icon hover animation without a loop
  • Replacing a static copy glyph with an animated one while keeping the same color and size inheritance
  • Interfaces that need the icon to play once on hover and respect the user's reduced-motion setting

Examples

Icon inside a copy button

Plain hover animation inside a button. The animation plays on mouse enter. Set type="button" so it does not submit a surrounding form.

icon-inside-a-copy-button.tsx
import { Copy01Icon } from '@/components/ui/copy-01';export function CopyButton() {  return (    <button type="button" className="inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm">      <Copy01Icon size={18} />      Copy link    </button>  );}

Imperative control via ref

Passing a ref switches the icon to controlled mode, so hovering no longer auto-plays the animation. Call startAnimation() from your own logic, such as after a successful copy.

imperative-control-via-ref.tsx
import { useRef } from 'react';import { Copy01Icon, type Copy01IconHandle } from '@/components/ui/copy-01';export function CopyFeedback() {  const iconRef = useRef<Copy01IconHandle>(null);  const handleCopy = async () => {    await navigator.clipboard.writeText('https://example.com');    iconRef.current?.startAnimation();  };  return (    <button type="button" onClick={handleCopy} aria-label="Copy link">      <Copy01Icon ref={iconRef} size={24} />    </button>  );}

Custom size and color with wrapper handlers

size sets the SVG width and height in pixels. className is applied to the outer div, so Tailwind text color flows into currentColor. onMouseEnter and onMouseLeave are forwarded to the wrapper.

custom-size-and-color-with-wrapper-handlers.tsx
import { Copy01Icon } from '@/components/ui/copy-01';export function ToolbarCopy() {  return (    <Copy01Icon      size={32}      className="text-blue-600 cursor-pointer"      onMouseEnter={() => console.log('hover')}      onMouseLeave={() => console.log('leave')}    />  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24.
classNamestring—Class name applied to the outer wrapper div. Use it to set color through currentColor, or to set layout.
onMouseEnterMouseEventHandler<HTMLDivElement>—Called before the built-in hover animation starts. Forwarded from the wrapper div.
onMouseLeaveMouseEventHandler<HTMLDivElement>—Called before the built-in leave handler runs. Forwarded from the wrapper div. Stop logic only takes effect when the internal loops option is true, which this icon does not set.
refRef<Copy01IconHandle>—Exposes startAnimation() and stopAnimation(). Attaching a ref disables automatic hover playback so that code controls the animation. stopAnimation() is a no-op in this build because looping is disabled.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, data-*, etc.) are spread onto the outer wrapper div.

Accessibility

  • The SVG has no title or role, so it is decorative. Provide an accessible name on the parent button or link, such as aria-label="Copy", or visible text.
  • The outer div is a non-interactive element. Put the icon inside a button or link for keyboard access, and pass type="button" for buttons inside forms.
  • The animation respects prefers-reduced-motion through useReducedMotion. When reduced motion is requested, startAnimation returns early and the icon does not move.
  • Hover-only animation gives no feedback to keyboard or touch users. Repeat the meaning through text labels or use ref-driven startAnimation after a state change, such as a copy success.

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 "copy-01" component (hugeicons-animated/copy-01) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/copy-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, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { Copy01Icon } from '@/components/ui/copy-01';export default function Example() {  return <Copy01Icon size={28} className="text-foreground" />;}```

Files & dependencies

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

Looks similar, elsewhere