Morphing Icon

An animated micro-interaction wrapper that smoothly morphs between two icon states with coordinated rotation, scale, and cross-fade transitions.

Click any action to trigger spring rotation & morph

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/morphing-icon

API Reference

PropTypeDefaultDescription
fromReact.ReactNodeundefinedDefault icon element shown when inactive
toReact.ReactNodeundefinedTarget icon element shown when active
activebooleanfalseWhether the target icon state is currently active
durationnumber0.3Duration of the morph transition in seconds
sizenumber20Width and height of the icon container in pixels
classNamestringundefinedOptional CSS class for styling the container