---
title: "Firework Dissolve"
description: "Launch a picture into the air. It rushes up to one point, bursts in a glowing sphere, and falls as sparks."
url: https://gelatinui.com/components/firework-dissolve
markdown_url: https://gelatinui.com/components/firework-dissolve.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/firework-dissolve"
version: "2026-11-18"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Firework Dissolve

> Launch a picture into the air. It rushes up to one point, bursts in a glowing sphere, and falls as sparks.

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

## When to use it

Best for: One big moment on a dark page, such as a launch, a milestone, or a new year.

- Use it for rare, large moments. It looks best on a dark surface.
- Set `tint` to the color of the sparks.
- Raise `force` for a wider burst when the page has room.

## When not to use it

- For paper pieces on a light page, use [Confetti Dissolve](https://gelatinui.com/components/confetti-dissolve.md).
- For a burst from the place of a press, use [Burst Dissolve](https://gelatinui.com/components/burst-dissolve.md).

## Notes for agents

- The burst point is always in the upper middle of the box.
- Sparks spread past every side of the box. A parent with `overflow-hidden` cuts them.
- `gravity` sets how fast the sparks fall after the burst.
- Show one at a time: each picture can have many sparks.

## Anatomy

```text
FireworkDissolve
```

## API reference

### FireworkDissolve

| 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. |
| `origin` | `GrainOrigin` |  | Where the effect starts. `press` is the last press in the picture. |
| `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 launch and the burst take, in ms. Default `2600`. |
| `force` | `number` |  | How wide the burst opens. Default `1`. |
| `gravity` | `number` |  | How fast the sparks fall. Default `1`. |
| `tint` | `string` |  | The color of the sparks, any CSS color. Default `oklch(0.85 0.18 70)`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| FireworkDissolve | `firework-dissolve` |  |  |  |

## Usage

Launch the album cover on a dark panel.

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-pro/firework-dissolve @gelatin-ui/button
```

```tsx title="new-year-album.tsx"
"use client";

import { useState } from "react";

import { FireworkDissolve } from "@/components/pro/effects/firework-dissolve";
import { Button } from "@/components/ui/button";

export function NewYearAlbum() {
  const [launched, setLaunched] = useState(false);
  return (
    <section className="dark flex w-full max-w-lg flex-col items-center gap-4 rounded-2xl bg-background p-24 text-foreground">
      <FireworkDissolve
        src="/photos/coast-aerial.webp"
        alt="A coast seen from the air"
        dissolved={launched}
        tint="oklch(0.84 0.17 85)"
      />
      <Button
        variant="secondary"
        onClick={() => {
          setLaunched((value) => {
            return !value;
          });
        }}
      >
        {launched ? "Replay" : "Launch"}
      </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-pro/firework-dissolve
```

It adds 35 registry items: 34 files, 6540 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

- [Confetti Dissolve](https://gelatinui.com/components/confetti-dissolve.md)
- [Burst Dissolve](https://gelatinui.com/components/burst-dissolve.md)
- [Starfield](https://gelatinui.com/components/starfield.md)
- [Scratch Card](https://gelatinui.com/components/scratch-card.md)

## Motion

| Part | Motion |
| --- | --- |
| Launch and burst | heatPrint · 2.6s · the picture gathers at one point, bursts, and falls as glowing sparks |
| Back | heatPrint · 2.6s · the sparks collect and the picture lands |
