Micro-interactions

Dissolve

An element disintegrates into drifting shadow-motes on dismiss, and reforms on command.

Install

bun add gsap clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/dissolve/dissolve.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
dismissedbooleanfalseToggle to disintegrate; toggle back to reform.
particleGapnumber4Sampling stride; lower is finer motes.
driftnumber60How far the motes scatter.
durationnumber1Length of the dissolve.
staggernumber0.4Spread of per-mote start times.
gravitynumber-0.4Vertical bias; negative rises like ash.
swirlnumber0.5Turbulent curl on the mote paths.
reformOnTriggerbooleantrueReassemble from motes when re-triggered.
moteColorstring (hex)"#a855f7"Amethyst tint blended into the shadow-motes.

What It Demonstrates

Enter / Exit
The animation an element plays when it's added to or removed from the screen.
Stagger
Animate several items one after another with a small delay between each, creating a cascade.
Reveal
Content is uncovered gradually, often by animating a clip-path or mask.

Related Components

Appears In