Skip to main content

Morphing Icons

Icons that transform through actual shape transformation, not crossfades. Inspired by Benji’s experiments with Claude.

Core Concept

Every icon uses exactly three SVG lines. Icons that need fewer lines collapse the extras to invisible points. This means any icon can morph into any other since they share the same underlying structure.

Three-Line Structure

All icons are defined with three lines, each with coordinates and optional opacity:

Collapsed Lines

When an icon needs fewer than three lines, unused lines collapse to a single point at the center with zero opacity:

Example Icons

Minus Icon (1 line + 2 collapsed)

Check Icon (2 lines + 1 collapsed)

Rotation Groups

Icons with shared base shapes can rotate between variants instead of morphing lines. This is controlled by the group property:
When transitioning between icons in the same group, the component rotates the existing lines rather than morphing them:

Animation Implementation

The morphing effect uses motion’s spring physics to animate line coordinates:
Default transition uses a custom easing curve for smooth, natural movement:

Accessibility

The component respects user motion preferences:

Usage Example

Available Icons

The system supports 27 icons:
  • Navigation: menu, cross, chevron-right, chevron-down, chevron-left, chevron-up, arrow-right, arrow-down, arrow-left, arrow-up
  • Actions: plus, minus, check, play, pause, download, upload, external
  • Symbols: equals, asterisk, more, grip, slash, corner

Reference

Inspired by Benji’s experiments with Claude, demonstrating how AI-assisted design can explore systematic constraints that lead to elegant solutions.