Message Square Check

An animated message-square icon with a checkmark inside a speech bubble. The checkmark draws itself in on hover or via an imperative ref handle, and it reverses when the animation stops.

Message Square 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 https://lucide-animated.com/r/message-square-check.json

Usage

usage.tsx
import { MessageSquareCheckIcon } from "@/components/ui/message-square-check";export default function Example() {  return <MessageSquareCheckIcon size={28} className="text-foreground" />;}
  • Showing a confirmed, sent, delivered, or read state for a message or chat item.
  • Adding a micro-interaction to a feedback, support, or 'message resolved' button or menu entry.
  • Indicating a completed conversation or approved comment in a dashboard or inbox UI.
  • Use the imperative ref handle when the animation should be triggered by app state rather than hover.

Examples

Hover to animate

The checkmark draws in on mouse enter and resets on mouse leave. No ref is needed.

hover-to-animate.tsx
import { MessageSquareCheckIcon } from "@/components/ui/message-square-check";export default function HoverExample() {  return (    <div className="inline-flex cursor-pointer items-center gap-2 text-sm">      <MessageSquareCheckIcon size={24} />      <span>Message resolved</span>    </div>  );}

Trigger from a ref

Call startAnimation and stopAnimation through the exported handle type. Mouse handlers are then ignored by the component's internal animation logic.

trigger-from-a-ref.tsx
import { useRef } from "react";import { MessageSquareCheckIcon, type MessageSquareCheckIconHandle } from "@/components/ui/message-square-check";export default function RefExample() {  const iconRef = useRef<MessageSquareCheckIconHandle>(null);  return (    <button      type="button"      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}      className="rounded-md p-2"    >      <MessageSquareCheckIcon ref={iconRef} size={28} />    </button>  );}

Status badge with sent confirmation

Plays the animation once after an async action succeeds.

status-badge-with-sent-confirmation.tsx
import { useEffect, useRef } from "react";import { MessageSquareCheckIcon, type MessageSquareCheckIconHandle } from "@/components/ui/message-square-check";interface SentBadgeProps {  sent: boolean;}export default function SentBadge({ sent }: SentBadgeProps) {  const iconRef = useRef<MessageSquareCheckIconHandle>(null);  useEffect(() => {    if (sent) {      iconRef.current?.startAnimation();    } else {      iconRef.current?.stopAnimation();    }  }, [sent]);  return (    <div className="flex items-center gap-1 text-emerald-600">      <MessageSquareCheckIcon ref={iconRef} size={20} />      <span className="text-xs">{sent ? "Sent" : "Sending..."}</span>    </div>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. Applied to both the width and height attributes of the svg element.
classNamestring—Class names applied to the outer wrapper div. Passed through cn(). Use text-* classes to change the stroke color, since the stroke is currentColor.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler. When the component is controlled via ref, this is called instead of the built-in hover animation. Otherwise the animation runs first and this is not called.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler. Same controlled-mode behavior as onMouseEnter.
refReact.Ref<MessageSquareCheckIconHandle>—Forwarded to the imperative handle, not the DOM node. Exposes startAnimation() (plays the checkmark draw-in) and stopAnimation() (resets it to the normal state).
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, role, data-*, etc.) are spread onto the outer wrapper div.

Accessibility

  • The SVG has no title, desc, or role. If the icon conveys meaning on its own, add role="img" and aria-label to the wrapper, or pass aria-hidden="true" when adjacent text already explains the state.
  • The animation is hover or ref triggered and does not loop or auto-play, so it does not create motion that needs a reduced-motion override. Avoid triggering it automatically on mount for users who prefer reduced motion.
  • When used as an interactive control, wrap the icon in a native button or link with an accessible name. Hover-only feedback is not available to keyboard or touch users, so pair it with a visible text label or a focus style.
  • The wrapper is a plain div. Attach role and keyboard handlers yourself when it represents a control.

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 "Message Square Check" component (lucide-animated/message-square-check) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/message-square-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 { MessageSquareCheckIcon } from "@/components/ui/message-square-check";export default function Example() {  return <MessageSquareCheckIcon size={28} className="text-foreground" />;}```

Files & dependencies

  • message-square-check.tsx
dependenciesmotion

Looks similar, elsewhere