Git Pull Request Closed
An animated Lucide-style git-pull-request-closed icon built on Motion. Hovering draws the two commit circles, the connecting line, and the closing X in a staggered sequence, and it can also be triggered imperatively through a ref.


shadcn add · no workarounds · theme neutral (none shipped)Installation
Usage
import { GitPullRequestClosedIcon } from "@/components/ui/git-pull-request-closed";export default function Example() { return <GitPullRequestClosedIcon />;}- Showing a closed or declined pull request status in developer dashboards, changelogs, or repository lists
- Adding a playful hover micro-interaction to a git-related button, link, or menu item
- Triggering the closed-PR animation programmatically, for example when a PR state changes, using the exported ref handle
- Use a static icon instead when motion should be avoided or the icon sits in dense, frequently re-rendered lists
Examples
Basic hover icon
Renders the icon at its default 28px size. Hovering the wrapper plays the animation, and leaving it resets the icon.
import { GitPullRequestClosedIcon } from "@/components/ui/git-pull-request-closed";export default function BasicExample() { return <GitPullRequestClosedIcon />;}Custom size and color
Sets a larger size with the size prop and colors the icon through className, since the stroke uses currentColor.
import { GitPullRequestClosedIcon } from "@/components/ui/git-pull-request-closed";export default function ColorExample() { return ( <GitPullRequestClosedIcon size={40} className="text-rose-500" /> );}Controlled via ref
Uses the exported handle to start the animation when a PR is closed. Because a ref is attached, the built-in hover handlers defer to the onMouseEnter and onMouseLeave props instead of animating.
import { useRef } from "react";import { GitPullRequestClosedIcon, type GitPullRequestClosedIconHandle,} from "@/components/ui/git-pull-request-closed";export default function ControlledExample() { const iconRef = useRef<GitPullRequestClosedIconHandle>(null); return ( <div onClick={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} > <GitPullRequestClosedIcon ref={iconRef} /> </div> );}Pull request list row
Places the icon next to a closed pull request title in a list, with an accessible label on the wrapper.
import { GitPullRequestClosedIcon } from "@/components/ui/git-pull-request-closed";export default function PullRequestRow() { return ( <li className="flex items-center gap-3 text-sm"> <GitPullRequestClosedIcon size={20} className="text-red-600" role="img" aria-label="Pull request closed" /> <span>Fix login redirect loop</span> </li> );}API reference
Accessibility
- The SVG has no title or text alternative, so the icon is announced only if the wrapper gets a label. Pass role="img" and aria-label (for example "Pull request closed") when the icon conveys meaning.
- If the icon is purely decorative next to visible text, pass aria-hidden="true" to the wrapper so screen readers skip it.
- The wrapper div is not focusable and has no keyboard handlers. If the icon triggers an action, place it inside a button or link that provides focus and keyboard support.
- The component does not check prefers-reduced-motion. Disable the animation for users who request reduced motion by using the ref handle or by not passing hover-driven animation in that context.
- Motion animates stroke geometry only. Color contrast depends on the currentColor value you set through className, so make sure it meets WCAG contrast requirements against its background.
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 "Git Pull Request Closed" component (lucide-animated/git-pull-request-closed) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/git-pull-request-closed.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, ref, onMouseEnter, onMouseLeave, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { GitPullRequestClosedIcon } from "@/components/ui/git-pull-request-closed";export default function Example() { return <GitPullRequestClosedIcon />;}```Files & dependencies
- git-pull-request-closed.tsx