IconMorph
Icon with blur-crossfade morph animation between icon changes. Drop-in replacement for Icon when you need animated transitions. The icon stays in place while crossfading with a blur effect.
Usage
import { IconMorph, IconMorphProps } from "@desk/ui/components/icon-morph";Best practices
Change
morphKeywhenevericonchanges (e.g. play↔pause) — the crossfade is keyed off it, so a stale key swaps the new glyph in with no morph.Use it as the animated drop-in for
Icon; for a plain static glyph stay onIconand skip the extraAnimatePresence/motion cost.Needs
ReducedMotionProviderfor the blur-crossfade to run and honour reduced motion; likeIconit rendersaria-hidden, so name the control elsewhere.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| enterDuration | number | Duration for enter animation in seconds. Defaults to | |
| enterEasing | EasingValue | Easing for enter animation. Accepts named preset or bezier tuple. Defaults to | |
| exitDuration | number | Duration for exit animation in seconds. Defaults to | |
| exitEasing | EasingValue | Easing for exit animation. Accepts named preset or bezier tuple. Defaults to | |
| icon | LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | Icon component from lucide-react or any SVG React component. | |
| morphKey | string | Unique key to trigger morph animation when icon changes. | |
| size | IconSize | Size scale for icons. Defaults to |
Also exports
- interface
IconMorphProps
Composition
Builds on
Used by