document-currency-euro
DocumentCurrencyEuroIcon is an animated React SVG icon of a document with a folded corner and a euro sign, based on Heroicons outline style. On hover it redraws the euro glyph stroke, and it can also be driven programmatically through a ref.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @heroicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { DocumentCurrencyEuroIcon } from "@/components/ui/document-currency-euro";export function Example() { return <DocumentCurrencyEuroIcon />;}- Showing a euro price, invoice, or currency export action where a document icon with a currency sign is needed
- Adding a subtle micro-interaction to a button, menu item, or table row that hands off hover feedback to the icon
- Triggering the euro-drawing animation from parent state (for example after a successful action) via the exposed ref handle
- Replacing a static document-with-currency icon in a Heroicons-style UI with an animated variant of the same design
Examples
Hover animation with custom size and color
Default hover behavior with size set to 32 and the color inherited from a Tailwind text class.
import { DocumentCurrencyEuroIcon } from "@/components/ui/document-currency-euro";export function HoverIcon() { return <DocumentCurrencyEuroIcon size={32} className="text-emerald-600" />;}Programmatic control through the ref
Attaching a ref makes the icon controlled: hover no longer animates it by itself, and the parent calls startAnimation and stopAnimation.
import { useRef } from "react";import { DocumentCurrencyEuroIcon, type DocumentCurrencyEuroIconHandle } from "@/components/ui/document-currency-euro";export function ExportButton() { const iconRef = useRef<DocumentCurrencyEuroIconHandle>(null); return ( <button type="button" className="inline-flex items-center gap-2 rounded-md border px-3 py-2" onMouseEnter={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} > <DocumentCurrencyEuroIcon ref={iconRef} size={16} /> Export </button> );}Invoice list rows with hover feedback
Multiple icons in a list, each animating on its own row hover using the default uncontrolled behavior.
import { DocumentCurrencyEuroIcon } from "@/components/ui/document-currency-euro";const invoices = ["Invoice 001", "Invoice 002", "Invoice 003"];export function InvoiceList() { return ( <ul className="space-y-2"> {invoices.map((name) => ( <li key={name} className="flex items-center gap-3 text-sm"> <DocumentCurrencyEuroIcon size={20} className="text-amber-500" /> {name} </li> ))} </ul> );}Passing extra div props
Because the props extend HTMLAttributes of a div, standard attributes such as aria-label, title, and data-* can be passed through.
import { DocumentCurrencyEuroIcon } from "@/components/ui/document-currency-euro";export function LabeledIcon() { return ( <DocumentCurrencyEuroIcon role="img" aria-label="Euro document" title="Euro document" data-testid="euro-doc-icon" /> );}API reference
Accessibility
- The root is a plain div and the svg has no title or role by default, so the icon is decorative. If it conveys meaning on its own, pass role="img" and an aria-label (or a visible text label next to it).
- If the icon is purely decorative next to visible text, add aria-hidden="true" to avoid redundant announcements.
- The animation is a visual flourish only and conveys no information that is not also present in the static icon, so it is acceptable for users who rely on hover feedback to be unaware of it.
- For users with reduced-motion preferences, consider disabling the trigger via a ref-controlled wrapper that skips startAnimation, since the draw-in motion lasts about 0.6s.
- Keyboard users do not get hover events; if the icon signals an action, make the surrounding control focusable and call startAnimation from onFocus and stopAnimation from onBlur through the ref.
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 "document-currency-euro" component (heroicons-animated/document-currency-euro) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/document-currency-euro2. 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 { DocumentCurrencyEuroIcon } from "@/components/ui/document-currency-euro";export function Example() { return <DocumentCurrencyEuroIcon />;}```Files & dependencies
- document-currency-euro.tsx