Mail Check
An animated mail icon in the lucide style that draws a check mark inside an envelope on hover, with an imperative handle to start or stop the animation programmatically. It is built on motion/react and forwards its ref to expose startAnimation and stopAnimation.


Installed with plain
See how it was built shadcn add · no workarounds · theme neutral (none shipped)Installation
pnpm dlx shadcn@latest add https://lucide-animated.com/r/mail-check.json
Usage
usage.tsx
import { MailCheckIcon } from "@/components/ui/mail-check";export default function Example() { return <MailCheckIcon size={28} className="text-foreground" />;}- Showing a confirmed or verified email state, such as 'message sent' or 'email verified' feedback
- Adding a playful hover micro-interaction to email, inbox, or newsletter-subscribe buttons and links
- Driving the check-mark animation programmatically via a ref when a form submission succeeds
- Replacing a static mail icon in navigation or settings where subtle motion is desired
Examples
Hover-triggered icon in a button
The icon animates on mouse enter and resets on mouse leave, with no ref needed.
hover-triggered-icon-in-a-button.tsx
import { MailCheckIcon } from "@/components/ui/mail-check";export default function SubscribeButton() { return ( <button className="inline-flex items-center gap-2 rounded-md border px-4 py-2"> <MailCheckIcon size={20} /> Subscribe </button> );}Programmatic control via ref
Use the imperative handle to start the check animation after an async submit succeeds.
programmatic-control-via-ref.tsx
"use client";import { useRef } from "react";import { MailCheckIcon, type MailCheckIconHandle } from "@/components/ui/mail-check";export default function VerifyEmail() { const iconRef = useRef<MailCheckIconHandle>(null); const handleSubmit = async () => { await new Promise((r) => setTimeout(r, 500)); iconRef.current?.startAnimation(); }; return ( <div onClick={handleSubmit} className="cursor-pointer"> <MailCheckIcon ref={iconRef} size={32} /> </div> );}Larger icon with custom color
Scale the icon with size and color it using Tailwind text utilities.
larger-icon-with-custom-color.tsx
import { MailCheckIcon } from "@/components/ui/mail-check";export default function Hero() { return <MailCheckIcon size={48} className="text-emerald-500" />;}API reference
PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels.
classNamestring—Class names applied to the wrapper div, passed through cn().
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. When the ref handle is attached, it is called instead of the built-in hover animation.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. When the ref handle is attached, it is called instead of the built-in hover animation.
refReact.Ref<MailCheckIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation() to control the check-mark animation imperatively.
Accessibility
- The icon is decorative SVG with no role or aria-label; when it conveys meaning, wrap it in an element with an accessible name or pass aria-label and role="img" via the spread props on the wrapper div.
- Hover-only animation provides no information to keyboard or touch users; ensure the status it signals is also conveyed in text.
- Respect prefers-reduced-motion by disabling startAnimation calls or conditionally triggering the ref when the user prefers reduced motion.
- Rest props such as aria-hidden are forwarded to the wrapper div, so set aria-hidden="true" when the icon is purely decorative.
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 "Mail Check" component (lucide-animated/mail-check) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/mail-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.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { MailCheckIcon } from "@/components/ui/mail-check";export default function Example() { return <MailCheckIcon size={28} className="text-foreground" />;}```Files & dependencies
- mail-check.tsx
dependenciesmotion