Getting Started
Install lucide-motion and render your first animated icon.
Installation
bun add lucide-motionPeer dependencies: react, react-dom, motion.
Your first icon
import { Heart } from "lucide-motion";
export default function Page() {
return <Heart size={32} />;
}Hover it. The icon draws itself on. That's the default behavior — no configuration required.
Migrating from lucide-react
If your project already uses lucide-react, the change is one line:
- import { Heart, Search, ArrowRight } from "lucide-react";
+ import { Heart, Search, ArrowRight } from "lucide-motion";Every lucide-react prop works identically:
size,color,strokeWidth,absoluteStrokeWidthclassName,style,onClick, all standard SVG attributesref— exposes aMotionIconHandle(play,reset,node); seetrigger="manual"
Each icon is also exported with an Icon suffix alias (Heart / HeartIcon), so either convention works.
What's different
Beyond lucide-react's API, this library adds motion props (reference):
trigger— when/how the animation fires (hover,click,mount,in-view,parent-hover,manual)duration,delay,stagger,easing,repeat— timing controlsonLeave— what happens when hover ends (complete,snap,redraw)reducedMotion— respect / force / disable the OS accessibility preferencevariants— escape hatch to replace the draw motion entirely
All optional. The defaults are sensible — installing the package and using icons unchanged gives you good motion out of the box.