---
title: "Sparkle Dissolve"
description: "A picture that twinkles away, each grain flashing once as it goes. Use it to grant a wish or finish a purchase."
url: https://gelatinui.com/components/sparkle-dissolve
markdown_url: https://gelatinui.com/components/sparkle-dissolve.md
access: free
install: "npx shadcn@latest add @gelatin-ui/sparkle-dissolve"
registry_item: https://gelatinui.com/r/sparkle-dissolve.json
version: "2026-11-18"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Sparkle Dissolve

> A picture that twinkles away, each grain flashing once as it goes. Use it to grant a wish or finish a purchase.

Page: https://gelatinui.com/components/sparkle-dissolve

## When to use it

Best for: A small, happy moment after a purchase, a claim, or an unlock.

- Keep it for good news: the gold flash reads as a reward.
- Set `tint` to a silver or brand color.
- Raise `amplitude` for larger flashes on big pictures.

## When not to use it

- For a removal that stays calm and flat, use [Mosaic Dissolve](https://gelatinui.com/components/mosaic-dissolve.md).
- For pieces that float away, use [Bubble Dissolve](https://gelatinui.com/components/bubble-dissolve.md).

## Notes for agents

- Grains go in random order, so no edge or direction leads. It has no `origin` prop.
- Each grain flashes once in `tint`, grows a little, lifts a few pixels, and winks out.
- The flashes come one after another, never as a page-wide flash.
- It stays almost inside the box: only a thin band above and at the sides.

## Anatomy

```text
SparkleDissolve
```

## API reference

### SparkleDissolve

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | `string` |  | The picture URL. Give `src` or `source`. |
| `source` | `union` |  | A picture the page already has: an `<img>`, a `<canvas>`, an `ImageBitmap`, or an `OffscreenCanvas`. |
| `alt` | `string` |  | Names the picture for screen readers while it shows. |
| `crossOrigin` | `GrainCrossOrigin` |  | The CORS mode of a picture on another origin: the grains read its pixels. |
| `fit` | `GrainFit` |  | How the picture fills the box, as `object-fit`. Default `cover`. |
| `grainSize` | `number` |  | The side of one grain in CSS px. A very large box raises it, so the effect stays smooth. |
| `dissolved` | `boolean` |  | 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`. |
| `progress` | `number` |  | From 0 (whole) to 1 (gone): a gesture drives the effect and no clock runs. Leave it out to play. |
| `seed` | `number` |  | The same seed gives the same motion. Default: from the picture URL. |
| `onDissolveEnd` | `function` |  | Called when the last grain has left (or the fade has ended). |
| `onRestoreEnd` | `function` |  | Called when the picture is whole again after a played return. |
| `spread` | `number` |  | From 0 to 0.85: how much of the effect passes between the first grain that leaves and the last. |
| `jitter` | `number` |  | From 0 to 0.85: how much of each grain's start is random. |
| `duration` | `number` |  | How long the picture takes to twinkle away, in ms. Default `1800`. |
| `amplitude` | `number` |  | From 0 to 2: how much a grain grows as it flashes. Default `1`. |
| `tint` | `string` |  | The color of the flash, any CSS color. Default `oklch(0.9 0.15 90)`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| SparkleDissolve | `sparkle-dissolve` |  |  |  |

## Usage

Let the product twinkle away once the order goes through.

The sample also uses `button`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui/sparkle-dissolve @gelatin-ui/button
```

```tsx title="wish-card.tsx"
"use client";

import { useState } from "react";

import { SparkleDissolve } from "@/components/effects/sparkle-dissolve";
import { Button } from "@/components/ui/button";

export function WishCard() {
  const [granted, setGranted] = useState(false);
  return (
    <section className="flex w-80 max-w-full flex-col gap-3 text-center">
      <SparkleDissolve
        src="/photos/white-sneaker.webp"
        alt="A white running sneaker"
        dissolved={granted}
        className="w-full"
      />
      <p className="text-sm text-muted-foreground">
        {granted ? "Wish granted. It ships on Monday." : "Runner sneaker, limited"}
      </p>
      <Button onClick={() => setGranted(true)} disabled={granted}>
        Make a wish
      </Button>
    </section>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/sparkle-dissolve
```

It adds 35 registry items: 34 files, 6524 lines, and the npm packages `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `xstate`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Bubble Dissolve](https://gelatinui.com/components/bubble-dissolve.md)
- [Mosaic Dissolve](https://gelatinui.com/components/mosaic-dissolve.md)
- [Scratch Card](https://gelatinui.com/components/scratch-card.md)
- [Receipt Printer](https://gelatinui.com/components/receipt-printer.md)

## Motion

| Part | Motion |
| --- | --- |
| Out | reactionFloat · 1.8s · grains flash in random order, grow, and wink out |
| Back | reactionFloat · 1.8s · the flashes return one by one and settle |
