---
title: "Pixel Dissolve"
description: "Clear a picture like an 8-bit game screen. Large blocks hop one cell, drop on a hard grid, and cut out with no fade."
url: https://gelatinui.com/components/pixel-dissolve
markdown_url: https://gelatinui.com/components/pixel-dissolve.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/pixel-dissolve"
version: "2026-11-18"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Pixel Dissolve

> Clear a picture like an 8-bit game screen. Large blocks hop one cell, drop on a hard grid, and cut out with no fade.

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

## When to use it

Best for: Game screens and retro brands, where hard steps look right and a soft fade does not.

- Use it for games, rewards, and playful retro pages.
- Raise `grainSize` for fewer and larger blocks.
- Set `steps` above 1 for rougher, longer jumps.

## When not to use it

- To shrink tiles in place with no fall, use [Mosaic Dissolve](https://gelatinui.com/components/mosaic-dissolve.md).
- For a broken signal, use [Glitch Dissolve](https://gelatinui.com/components/glitch-dissolve.md).

## Notes for agents

- Blocks are 8 px by default, and every move snaps to that grid.
- The top rows leave first. Pass `origin` to change the order.
- Blocks fall below the box, so leave free space under it.
- Blocks cut out at once near the end of their fall. There is no fade to tune.

## Anatomy

```text
PixelDissolve
```

## API reference

### PixelDissolve

| 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 blocks take to fall away, in ms. Default `1400`. |
| `gravity` | `number` |  | How fast the blocks fall. Default `1`. |
| `steps` | `number` |  | How many grid cells a block jumps at a time. Default `1`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| PixelDissolve | `pixel-dissolve` |  |  |  |

## Usage

Clear the level, then show the next picture at once.

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

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

import { useState } from "react";

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

const WINTER = { src: "/photos/winter-cabin.webp", alt: "A lake cabin under snow" };
const SUMMER = { src: "/photos/summer-cabin.webp", alt: "A lake cabin on a summer day" };

export function LevelCard() {
  const [level, setLevel] = useState(0);
  const [cleared, setCleared] = useState(false);
  const picture = level % 2 === 0 ? WINTER : SUMMER;
  return (
    <div className="flex w-80 max-w-full flex-col gap-3 pb-40">
      <PixelDissolve
        src={picture.src}
        alt={picture.alt}
        dissolved={cleared}
        restore="instant"
        className="w-full"
        onDissolveEnd={() => {
          setLevel(level + 1);
          setCleared(false);
        }}
      />
      <Button
        disabled={cleared}
        onClick={() => {
          setCleared(true);
        }}
      >
        Next level
      </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/pixel-dissolve
```

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

- [Glitch Dissolve](https://gelatinui.com/components/glitch-dissolve.md)
- [Mosaic Dissolve](https://gelatinui.com/components/mosaic-dissolve.md)
- [Pipes](https://gelatinui.com/components/pipes.md)
- [Scratch Card](https://gelatinui.com/components/scratch-card.md)

## Motion

| Part | Motion |
| --- | --- |
| Fall | draw · 1.4s · blocks hop up one cell, then drop in whole cells and cut out |
| Back | draw · 1.4s · blocks jump up the grid into place |
