clipboard-document-check

An animated clipboard-with-check React icon that draws its check mark on hover, or when started through a ref. It is a self-contained registry:ui component that depends only on motion.

clipboard-document-check
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 @heroicons-animated/clipboard-document-check

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

Usage

usage.tsx
import { ClipboardDocumentCheckIcon } from "@/components/ui/clipboard-document-check";export function Example() {  return <ClipboardDocumentCheckIcon size={28} className="text-zinc-900" />;}
  • Confirming that a copy, save, or validation step succeeded, for example next to a 'Copy' button or in a success toast
  • Adding a playful micro-interaction to a list, table row, or toolbar action that hints at a completed check
  • Replacing a static checkmark-clipboard icon where hover feedback helps users understand the action
  • Driving the animation programmatically from a parent component (for example after an async request resolves) through the ref handle

Examples

Hover-triggered icon in a button

The default usage. The check mark animates on hover automatically, with no ref needed.

hover-triggered-icon-in-a-button.tsx
import { ClipboardDocumentCheckIcon } from "@/components/ui/clipboard-document-check";export function CopyButton() {  return (    <button type="button" className="inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm">      <ClipboardDocumentCheckIcon size={20} />      Copy link    </button>  );}

Programmatic control through the ref

Once a ref is attached, hover events are forwarded to your handlers instead of playing the animation, so the parent controls it via startAnimation and stopAnimation.

programmatic-control-through-the-ref.tsx
import { useRef } from "react";import { ClipboardDocumentCheckIcon } from "@/components/ui/clipboard-document-check";import type { ClipboardDocumentCheckIconHandle } from "@/components/ui/clipboard-document-check";export function SaveStatus() {  const iconRef = useRef<ClipboardDocumentCheckIconHandle>(null);  const handleSave = async () => {    await new Promise((resolve) => setTimeout(resolve, 500));    iconRef.current?.startAnimation();  };  return (    <div onClick={handleSave} onMouseLeave={() => iconRef.current?.stopAnimation()}>      <ClipboardDocumentCheckIcon ref={iconRef} size={24} />    </div>  );}

Sized and colored in a list row

Size is controlled with the size prop, and color comes from the className on the wrapper div, since the stroke uses currentColor.

sized-and-colored-in-a-list-row.tsx
import { ClipboardDocumentCheckIcon } from "@/components/ui/clipboard-document-check";export function ClipboardRow({ label }: { label: string }) {  return (    <li className="flex items-center justify-between rounded-md p-2 hover:bg-zinc-100">      <span>{label}</span>      <ClipboardDocumentCheckIcon size={18} className="text-emerald-600" aria-hidden="true" />    </li>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24.
classNamestring—Class names applied to the wrapping div through cn(). Use it to set color (via currentColor) or layout.
refReact.Ref<ClipboardDocumentCheckIconHandle>—Exposes startAnimation() and stopAnimation() imperatively. Attaching a ref switches the component to controlled mode, where mouse enter and leave call your onMouseEnter and onMouseLeave handlers instead of animating automatically.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse-enter handler on the wrapping div. In uncontrolled mode it runs after the animation starts. In controlled mode (ref attached) it replaces the automatic animation.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse-leave handler on the wrapping div. In uncontrolled mode it resets the animation. In controlled mode (ref attached) it replaces the automatic reset.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, data-*, and so on) are spread onto the wrapping div.

Accessibility

  • The SVG has no role, title, or aria-label. If the icon is decorative (next to visible text), pass aria-hidden="true" to the component; it is spread onto the wrapping div.
  • If the icon is the only content of a control, give the interactive parent an accessible name with aria-label or visually hidden text, because the icon itself provides no name.
  • Hover is the only trigger in uncontrolled mode, so keyboard and touch users get no animation. Information conveyed by the animation (such as success) must also be shown in text.
  • The component does not check prefers-reduced-motion. If motion sensitivity matters in your app, skip calling startAnimation or disable the animation in your own wrapper.
  • Colors use currentColor, so the icon keeps the contrast of its parent text color. Verify contrast in both light and dark themes.

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 "clipboard-document-check" component (heroicons-animated/clipboard-document-check) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/clipboard-document-check2. 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, ref, onMouseEnter, onMouseLeave, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ClipboardDocumentCheckIcon } from "@/components/ui/clipboard-document-check";export function Example() {  return <ClipboardDocumentCheckIcon size={28} className="text-zinc-900" />;}```

Files & dependencies

  • clipboard-document-check.tsx
dependenciesmotion

Looks similar, elsewhere