Clipboard Check
An animated clipboard icon whose check mark draws itself in when hovered, built with Motion. It exposes an imperative ref so you can start or stop the check animation from your own code.


shadcn add · no workarounds · theme neutral (none shipped)Installation
Usage
import { ClipboardCheckIcon } from "@/components/ui/clipboard-check";export default function Example() { return <ClipboardCheckIcon size={28} className="text-foreground" />;}- Confirming a successful copy-to-clipboard action in buttons, toasts, or inline controls.
- Indicating a completed checklist, form validation, or task-done state in an interactive UI.
- Adding a subtle hover micro-interaction to menus, cards, or navigation items.
- Driving the animation programmatically (for example after an async save) through the exposed ref handle.
Examples
Hover to animate
By default the check mark animates when the pointer enters the wrapper div and resets when it leaves.
import { ClipboardCheckIcon } from "@/components/ui/clipboard-check";export default function HoverExample() { return ( <div className="inline-flex cursor-pointer items-center gap-2 text-sm"> <ClipboardCheckIcon size={24} /> <span>Copy to clipboard</span> </div> );}Controlled via ref
Attaching the ref switches the icon into controlled mode, so hover no longer triggers the animation and you call startAnimation and stopAnimation yourself.
import { useRef } from "react";import { ClipboardCheckIcon, type ClipboardCheckIconHandle } from "@/components/ui/clipboard-check";export default function ControlledExample() { const iconRef = useRef<ClipboardCheckIconHandle>(null); return ( <button type="button" className="inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm" onClick={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} > <ClipboardCheckIcon ref={iconRef} size={20} /> Copied </button> );}Custom size and color
Size is set with the size prop, and color comes from Tailwind text utilities because the stroke uses currentColor.
import { ClipboardCheckIcon } from "@/components/ui/clipboard-check";export default function ColorExample() { return <ClipboardCheckIcon size={36} className="text-emerald-500" aria-hidden="true" />;}API reference
Accessibility
- The SVG has no title or aria-label; if the icon conveys meaning on its own, add aria-label or role="img" with a title on the wrapper, otherwise mark it aria-hidden="true" when adjacent text describes the action.
- The animation is purely visual and conveys no information that is not also present in text; always pair a status icon with a text label or an accessible announcement (for example a live region after a copy succeeds).
- Hover-only triggering is not keyboard-accessible. Wrap the icon in a focusable button and call startAnimation from onClick or onFocus through the ref.
- The motion is short (0.3s), but consider respecting prefers-reduced-motion by skipping startAnimation when the user prefers reduced motion.
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.
Use the "Clipboard Check" component (lucide-animated/clipboard-check) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/clipboard-check.json2. 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 { ClipboardCheckIcon } from "@/components/ui/clipboard-check";export default function Example() { return <ClipboardCheckIcon size={28} className="text-foreground" />;}```Files & dependencies
- clipboard-check.tsx