explaingit

guillermolg00/morphicons

Analysis updated 2026-08-13

1,016TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A lightweight library that animates one stroke-based icon morphing into another using spring physics, with bindings for React, Vue, and Svelte.

Mindmap

mindmap
  root((morphicons))
    What it does
      Morphs icons smoothly
      Spring physics
      Zero dependencies
    Tech stack
      TypeScript
      React
      Vue
      Svelte
    Use cases
      Menu toggle icons
      Drag gesture icons
      Lucide replacement
    Audience
      Frontend developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Replace a static menu icon with an animated X icon on toggle without writing custom animation code.

USE CASE 2

Build a settings panel where icons morph in response to drag gestures.

USE CASE 3

Swap lucide-react icons for morphicons as a near drop-in upgrade for smoother transitions.

USE CASE 4

Add icon morph animations to a server rendered site without a hydration flash.

What is it built with?

TypeScriptReactVueSvelte

How does it compare?

guillermolg00/morphiconsnyblnet/bentopablostanley/yoinks
Stars1,0161,0131,032
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedevelopergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

In plain English

morphicons is a small JavaScript and TypeScript library that lets one icon smoothly turn into another, with spring based physics driving the animation. Instead of icons snapping between states, or a developer having to hand write which direction an icon should rotate, morphicons works out the correct motion using geometry: if two icon shapes are basically the same shape rotated, it rotates between them, if they are different shapes, it blends them in a way that keeps proportions steady rather than stretching or shrinking oddly along the way. It ships with almost no size cost, weighing about 7 kilobytes after compression, and has no runtime dependencies of its own. It is a drop in replacement for the popular lucide-react icon components, meaning existing code that renders Lucide icons can often switch to morphicons with a small change. The library reads icon data, not finished icon components, so it pulls shapes directly from the base lucide package rather than the framework specific ones. Bindings are provided for React, Vue, and Svelte, each offering three ways to use it: an uncontrolled mode where changing a prop triggers the animation automatically, a controlled mode where a developer supplies the exact progress value for things like drag gestures, and an imperative mode for scripting a sequence of morphs. There is also a plain custom element version that works without any framework at all, plus an Astro specific version. Accessibility is handled by default, icons are hidden from screen readers unless a label is given, and rendering works cleanly on the server so there is no visible flash when the page loads. It can also respect a user's reduced motion operating system setting when that option is turned on. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Show me how to install morphicons and replace a static Lucide menu icon with an animated MorphIcon.
Prompt 2
Explain the difference between morphicons' uncontrolled, controlled, and imperative modes with a code example.
Prompt 3
Help me wire up a drag gesture that controls a MorphIcon's progress directly.
Prompt 4
How do I use morphicons in a Svelte project with reduced motion support turned on?

Frequently asked questions

What is morphicons?

A lightweight library that animates one stroke-based icon morphing into another using spring physics, with bindings for React, Vue, and Svelte.

What language is morphicons written in?

Mainly TypeScript. The stack also includes TypeScript, React, Vue.

How hard is morphicons to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is morphicons for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.