Receipt
An animated receipt icon from the lucide-animated registry that draws a dollar sign onto a torn-edge receipt on hover, built with motion/react. It can be triggered by hover or controlled imperatively through a ref.


shadcn add · no workarounds · theme neutral (none shipped)Installation
Usage
import { ReceiptIcon } from "@/components/ui/receipt"; export default function Example() { return <ReceiptIcon size={28} className="text-foreground" />; }- Showing payment, invoice, checkout, or expense-report sections where a receipt metaphor is needed
- Adding a subtle, hover-triggered micro-interaction to a pricing, billing, or transaction button or card
- Driving the animation programmatically (for example when a payment succeeds) through the exported ref handle
- Replacing a static receipt icon in a lucide-style icon set when motion adds clarity or delight
Examples
Hover-triggered icon in a button
Uses the default hover behavior inside a checkout button. No ref is needed; the animation plays on mouse enter and reverses on mouse leave.
import { ReceiptIcon } from "@/components/ui/receipt"; export function ViewInvoiceButton() { return <button type="button" className="inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm"><ReceiptIcon size={18} />View invoice</button>; }Programmatic control via ref
Attaches a ref to play the animation when a payment completes. Once a ref is attached, hover no longer animates the icon automatically.
import { useRef } from "react"; import { ReceiptIcon, type ReceiptIconHandle } from "@/components/ui/receipt"; export function PaymentStatus() { const iconRef = useRef<ReceiptIconHandle>(null); return <div onClick={() => iconRef.current?.startAnimation()} className="flex flex-col items-center gap-2"><ReceiptIcon ref={iconRef} size={40} className="text-emerald-600" /><button type="button" onClick={() => iconRef.current?.stopAnimation()}>Reset</button></div>; }Pricing card with a larger icon
Shows the icon at a larger size as a decorative header in a pricing card, with a custom hover callback handled through the ref-controlled mode.
import { useRef } from "react"; import { ReceiptIcon, type ReceiptIconHandle } from "@/components/ui/receipt"; export function InvoiceCard() { const ref = useRef<ReceiptIconHandle>(null); return <div className="rounded-xl border p-6" onMouseEnter={() => ref.current?.startAnimation()} onMouseLeave={() => ref.current?.stopAnimation()}><ReceiptIcon ref={ref} size={48} className="mb-4 text-primary" /><h3 className="text-lg font-semibold">Monthly invoice</h3></div>; }API reference
Accessibility
- The SVG has no title, desc, or role attribute, so it is treated as decorative. If the icon conveys meaning on its own, wrap it or pass aria-label and role="img" via the spread div props.
- When the icon sits inside a button or link that already has visible text, keep it decorative (aria-hidden="true" on the wrapper is acceptable) to avoid duplicate announcements.
- The animation is purely visual and conveys no information that is not also present in text. Consider respecting prefers-reduced-motion by not calling startAnimation in ref-controlled code when the user has requested reduced motion.
- The icon uses currentColor for stroke, so it inherits the surrounding text color and retains sufficient contrast when the parent color meets WCAG requirements.
- Hover-only activation means keyboard and touch users do not get the effect; the icon remains fully readable in its rest state, so no information is lost.
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 "Receipt" component (lucide-animated/receipt) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/receipt.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 { ReceiptIcon } from "@/components/ui/receipt"; export default function Example() { return <ReceiptIcon size={28} className="text-foreground" />; }```Files & dependencies
- receipt.tsx