Hand Fist

HandFistIcon is an animated fist-hand SVG icon built on Motion (motion/react) that bounces up and scales slightly when hovered or when its imperative handle is started. It is a forwardRef component exposing startAnimation and stopAnimation methods for programmatic control.

Hand Fist
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/hand-fist.json

Usage

usage.tsx
import { HandFistIcon } from "@/components/ui/hand-fist";export default function Example() {  return <HandFistIcon size={28} className="text-foreground" />;}
  • Use as a decorative or status icon for punch, power, strength, fight, or 'fist bump' actions in a button or menu item
  • Use inside a hover-triggered CTA or navigation item where a brief pump animation signals interactivity
  • Use as an imperative-triggered celebratory or emphasis indicator by calling startAnimation via ref after a success event
  • Use in dashboards or games UIs that need a lightweight animated Lucide-style icon without an extra icon library

Examples

Basic hover icon

Renders the icon at default size; hovering the wrapper div plays the pump animation.

basic-hover-icon.tsx
import { HandFistIcon } from "@/components/ui/hand-fist";export default function BasicExample() {  return (    <div className="flex items-center justify-center p-8">      <HandFistIcon />    </div>  );}

Button with hover animation

Places the icon inside a button so the pump plays when the button is hovered.

button-with-hover-animation.tsx
import { HandFistIcon } from "@/components/ui/hand-fist";export default function PunchButton() {  return (    <button className="inline-flex items-center gap-2 rounded-md border px-4 py-2 text-sm font-medium">      <HandFistIcon size={20} className="text-red-500" />      Power up    </button>  );}

Programmatic control via ref

Uses the forwarded ref to trigger startAnimation after an async success, with a stopAnimation reset.

programmatic-control-via-ref.tsx
import { useRef } from "react";import { Button } from "@/components/ui/button";import { HandFistIcon, type HandFistIconHandle } from "@/components/ui/hand-fist";export default function ControlledExample() {  const iconRef = useRef<HandFistIconHandle>(null);  return (    <div className="flex items-center gap-3">      <HandFistIcon ref={iconRef} size={32} />      <Button        onClick={() => iconRef.current?.startAnimation()}        onMouseLeave={() => iconRef.current?.stopAnimation()}      >        Trigger      </Button>    </div>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. Applied to both the width and height attributes of the motion.svg element.
classNamestring—Additional class names merged onto the outer wrapper div via cn(). Use it to set color (via text-* utilities, since stroke is currentColor) or spacing.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler on the wrapper div. When the ref handle is attached (controlled mode), this is called instead of the built-in animation trigger; otherwise it is called in addition to nothing and the animation plays automatically.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler on the wrapper div. In controlled mode it is called instead of the built-in reset animation; otherwise the icon returns to its normal state automatically.
refReact.Ref<HandFistIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation() imperative methods. Attaching the ref switches the component into controlled mode, disabling automatic hover animation.

Accessibility

  • The icon is a decorative SVG with no role, title, or aria-label; if it conveys meaning, wrap it in an element with an accessible name or add aria-label and role="img" via the spread HTML attributes.
  • Pass aria-hidden="true" on the icon when it sits next to visible text so screen readers do not announce it.
  • The animation is a short one-shot pump (about 0.8s, repeat 1); it is not looping, but consider honoring prefers-reduced-motion by disabling the ref trigger or hover handlers in user settings.
  • Because hover is the only default trigger, provide a non-hover path (e.g. calling startAnimation on focus or click) so keyboard and touch users get the same feedback.
  • Color contrast depends on the inherited currentColor; ensure the chosen text color meets WCAG contrast against the 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.

prompt.md
Use the "Hand Fist" component (lucide-animated/hand-fist) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/hand-fist.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 { HandFistIcon } from "@/components/ui/hand-fist";export default function Example() {  return <HandFistIcon size={28} className="text-foreground" />;}```

Files & dependencies

  • hand-fist.tsx
dependenciesmotion

Looks similar, elsewhere