---
title: "Stream Dissolve"
description: "Pour a file into the button that receives it. The image flows along a curve and shrinks into a trash, folder, or cart target."
url: https://gelatinui.com/components/stream-dissolve
markdown_url: https://gelatinui.com/components/stream-dissolve.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/stream-dissolve"
version: "2026-11-18"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Stream Dissolve

> Pour a file into the button that receives it. The image flows along a curve and shrinks into a trash, folder, or cart target.

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

## When to use it

Best for: A move into a place on the page, where people must see where the item went.

- Use it when the destination is on screen: a trash button, a cart, or a folder.
- Give the destination as `target`, a ref to its element.
- Change `arc` to bend the flight away from text or other controls.

## When not to use it

- For a flight with no destination, use [Swarm Dissolve](https://gelatinui.com/components/swarm-dissolve.md).
- To throw a card into a bin as paper, use [Crumple to Delete](https://gelatinui.com/components/crumple-to-delete.md).

## Notes for agents

- `target` is required: it is a React ref to the element that receives the picture.
- The part nearest the target leaves first, so the stream starts on the side of the target.
- The place of the target is read when the effect starts. Keep the target in place during the flight.
- `arc` goes from -1 to 1. A negative value bends the flight to the other side.

## Anatomy

```text
StreamDissolve
```

## API reference

### StreamDissolve

| 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. |
| `target` | `RefObject<Element \| null>` |  | The element the grains fly into, such as a trash button. |
| `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 flight into the target takes, in ms. Default `1800`. |
| `arc` | `number` |  | From -1 to 1: how far the flight bends to one side. Default `0.45`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| StreamDissolve | `stream-dissolve` |  |  |  |

## Usage

Pass the trash button as the target. The file pours into it.

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

```tsx title="file-row.tsx"
"use client";

import { TrashIcon } from "@phosphor-icons/react/ssr";
import { useRef, useState } from "react";

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

export function FileRow() {
  const trash = useRef<HTMLButtonElement>(null);
  const [trashed, setTrashed] = useState(false);
  return (
    <div className="flex items-end gap-6">
      <StreamDissolve
        src="/photos/ramen-night.webp"
        alt="A bowl of ramen with an egg and spring onion"
        dissolved={trashed}
        target={trash}
        arc={-0.3}
      />
      <Button
        ref={trash}
        variant="outline"
        size="icon-lg"
        aria-label={trashed ? "Restore ramen-night.webp" : "Move ramen-night.webp to the trash"}
        onClick={() => {
          setTrashed((value) => {
            return !value;
          });
        }}
      >
        <TrashIcon />
      </Button>
    </div>
  );
}
```

## 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/stream-dissolve
```

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

- [Swarm Dissolve](https://gelatinui.com/components/swarm-dissolve.md)
- [Vortex Dissolve](https://gelatinui.com/components/vortex-dissolve.md)
- [Crumple to Delete](https://gelatinui.com/components/crumple-to-delete.md)
- [Mask Reveal](https://gelatinui.com/components/mask-reveal.md)

## Motion

| Part | Motion |
| --- | --- |
| Pour | reactionFloat · 1.8s · the image runs along a curve and shrinks into the target |
| Back | reactionFloat · 1.8s · the stream leaves the target and rebuilds the image |
