---
title: "Vortex Dissolve"
description: "A picture that spirals into one point and is gone. Use it for clear all and close actions."
url: https://gelatinui.com/components/vortex-dissolve
markdown_url: https://gelatinui.com/components/vortex-dissolve.md
access: free
install: "npx shadcn@latest add @gelatin-ui/vortex-dissolve"
registry_item: https://gelatinui.com/r/vortex-dissolve.json
version: "2026-11-18"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Vortex Dissolve

> A picture that spirals into one point and is gone. Use it for clear all and close actions.

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

## When to use it

Best for: Clear all and close actions, where everything should end at one point.

- Use it when the page has no room: every grain stays inside the box.
- Pass an `origin` point to drain the picture into a corner or toward a control.
- Raise `turns` for a tight spiral, or lower it with a longer `duration` for a calm swirl.

## When not to use it

- For grains pushed out from the center, use [Burst Dissolve](https://gelatinui.com/components/burst-dissolve.md).
- For a pull to the outer edges, use [Magnet Dissolve](https://gelatinui.com/components/magnet-dissolve.md).

## Notes for agents

- The rim goes first, so the picture shrinks into the point as it turns.
- `origin` takes a side, `center`, or `{ x, y }` in box pixels.
- No grain leaves the box, so a parent with `overflow-hidden` does not cut it.
- For an entrance, mount it with `dissolved` on, then turn it off: the picture spirals out of the point.

## Anatomy

```text
VortexDissolve
```

## API reference

### VortexDissolve

| 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 picture takes to spiral away, in ms. Default `1800`. |
| `turns` | `number` |  | How many times the grains circle the point. Default `1.25`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| VortexDissolve | `vortex-dissolve` |  |  |  |

## Usage

Drain the wallpaper into its middle when the set is cleared.

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

```tsx title="wallpaper-tray.tsx"
"use client";

import { useState } from "react";

import { VortexDissolve } from "@/components/effects/vortex-dissolve";
import { Button } from "@/components/ui/button";

export function WallpaperTray() {
  const [cleared, setCleared] = useState(false);
  return (
    <section className="flex w-80 max-w-full flex-col gap-3 overflow-hidden rounded-2xl border p-3">
      <VortexDissolve
        src="/photos/moonlit-wave.webp"
        alt="A water serpent coils in a moonlit wave"
        dissolved={cleared}
        turns={2}
        className="w-full"
      />
      <Button variant="secondary" onClick={() => setCleared((value) => !value)}>
        {cleared ? "Restore" : "Clear all"}
      </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/vortex-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

- [Burst Dissolve](https://gelatinui.com/components/burst-dissolve.md)
- [Magnet Dissolve](https://gelatinui.com/components/magnet-dissolve.md)
- [Mask Reveal](https://gelatinui.com/components/mask-reveal.md)
- [Crumple to Delete](https://gelatinui.com/components/crumple-to-delete.md)

## Motion

| Part | Motion |
| --- | --- |
| Out | reactionFloat · 1.8s · grains circle in from the rim, shrink, and vanish at the point |
| Back | reactionFloat · 1.8s · the spiral unwinds from the point |
