---
title: "Shuffle Dissolve"
description: "A picture that scrambles itself in place, then fades. Use it to mix up or reset a draft."
url: https://gelatinui.com/components/shuffle-dissolve
markdown_url: https://gelatinui.com/components/shuffle-dissolve.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/shuffle-dissolve"
version: "2026-11-18"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Shuffle Dissolve

> A picture that scrambles itself in place, then fades. Use it to mix up or reset a draft.

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

## When to use it

Best for: A reset or a new round, where the picture should scramble in place.

- Use it for actions about order or chance, such as Reset or Shuffle.
- Raise `amplitude` for tall jumps across the box.
- Set `amplitude` to 0 for a flat slide with no arc.

## When not to use it

- For tiles that shrink with no travel, use [Mosaic Dissolve](https://gelatinui.com/components/mosaic-dissolve.md).
- For pieces that fall to the floor, use [Bounce Dissolve](https://gelatinui.com/components/bounce-dissolve.md).

## Notes for agents

- Every grain lands at its own random spot in the box, then fades there.
- The same `seed` gives the same scramble, so a test or a replay matches.
- It stays inside the box, so it is safe in tight layouts.
- Pieces are 5 px by default, large enough to follow one with the eye.

## Anatomy

```text
ShuffleDissolve
```

## API reference

### ShuffleDissolve

| 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 scramble takes, in ms. Default `1800`. |
| `amplitude` | `number` |  | From 0 to 2: how high a grain arcs on its jump. `0` is a flat slide. Default `1`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| ShuffleDissolve | `shuffle-dissolve` |  |  |  |

## Usage

Scramble the draft cover when the person starts over.

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

```tsx title="draft-cover.tsx"
"use client";

import { useState } from "react";

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

export function DraftCover() {
  const [reset, setReset] = useState(false);
  return (
    <div className="flex w-80 max-w-full flex-col gap-3 overflow-hidden">
      <ShuffleDissolve
        src="/photos/blog-cover.webp"
        alt="A blog page with a large photo"
        dissolved={reset}
        seed={7}
        className="w-full"
      />
      <Button variant="secondary" onClick={() => setReset((value) => !value)}>
        {reset ? "Unshuffle" : "Start over"}
      </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/shuffle-dissolve
```

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

- [Mosaic Dissolve](https://gelatinui.com/components/mosaic-dissolve.md)
- [Bounce Dissolve](https://gelatinui.com/components/bounce-dissolve.md)
- [Scratch Card](https://gelatinui.com/components/scratch-card.md)
- [Tilt](https://gelatinui.com/components/tilt.md)

## Motion

| Part | Motion |
| --- | --- |
| Out | reactionFloat · 1.8s · grains jump in arcs to random spots, shrink, and fade |
| Back | reactionFloat · 1.8s · the grains leap home from their random spots |
