Skip to content

Sand Dissolve

Free

A picture that falls apart into real sand when it is deleted: the grains pile up, slide, then pour away. Restore lifts them back.

  • React 19
  • Tailwind CSS 4

Added Nov 18, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Delete the photo, then drop its row when the sand has poured away.

The sample also uses Button. One command adds them with this item:

deletable-photo.tsx

SandDissolve

<div>
PropTypeDefaultDescription
srcstring—The picture URL. Give src or source.
source—A picture the page already has: an <img>, a <canvas>, an ImageBitmap, or an OffscreenCanvas.
altRequiredstring—Names the picture for screen readers while it shows.
crossOrigin"""anonymous""use-credentials"—The CORS mode of a picture on another origin: the grains read its pixels.
fit"contain""cover"—How the picture fills the box, as object-fit. Default cover.
grainSizenumber—The side of one grain in CSS px. A very large box raises it, so the effect stays smooth.
dissolvedboolean—The picture is gone (controlled). true takes it apart; false brings it back.
restore"instant""play"—How the picture comes back: play runs the effect backward, instant shows it at once. Default play.
progressnumber—From 0 (whole) to 1 (gone): a gesture drives the effect and no clock runs. Leave it out to play.
seednumber—The same seed gives the same motion. Default: from the picture URL.
onDissolveEnd—Called when the last grain has left (or the fade has ended).
onRestoreEnd—Called when the picture is whole again after a played return.
durationnumber—How long the pile takes to rise back into the picture, in ms. The fall keeps its own pace. Default 1800.
spreadnumber—From 0 to 0.85: how long the sweep takes to cross the picture. Default 0.35.
jitternumber—From 0 to 0.85: how ragged the edge of the sweep is. Default 0.2.
gravitynumber—How fast the sand falls and packs. Default 1.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Set dissolved when the person confirms the delete.
  • Remove the row from your list in onDissolveEnd, after the pile has poured away.
  • Raise gravity for a fast, tight pile, or lower grainSize for fine sand.
Back
reactionFloat · 1.8s · each grain rises from the pile in a low arc to its place
End
none · the whole picture replaces the grains in one frame
  1. AddedSand Dissolve.
Open the release