---
title: "Broom Dissolve"
description: "A picture swept off the side, its grains piling up in front of the broom. Use it to clear a cart or a list."
url: https://gelatinui.com/components/broom-dissolve
markdown_url: https://gelatinui.com/components/broom-dissolve.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/broom-dissolve"
version: "2026-11-18"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Broom Dissolve

> A picture swept off the side, its grains piling up in front of the broom. Use it to clear a cart or a list.

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

## When to use it

Best for: Clearing a cart or a list with one clear sweep to the side.

- Point `origin` at the side the sweep starts from: `start` or `end`.
- Drive `progress` from a swipe, so the finger holds the broom.
- Raise `force` to throw the pile farther past the edge.

## When not to use it

- For a soft drift with no push, use [Dust Dissolve](https://gelatinui.com/components/dust-dissolve.md).
- For rows that streak to both sides, use [Scan Dissolve](https://gelatinui.com/components/scan-dissolve.md).

## Notes for agents

- Grains near the start move first and collect toward the far edge, so a pile builds in front of the sweep.
- Under `force` 1 the pile fades before the edge. At 1 it clears the edge.
- At `force` 1 the pile ends just past the far edge. A higher value carries it farther, up to half a box.
- In right-to-left text the default sweep runs from right to left.

## Anatomy

```text
BroomDissolve
```

## API reference

### BroomDissolve

| 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 sweep takes, in ms. Default `1800`. |
| `force` | `number` |  | How far the broom pushes the pile. Under `1` it fades before the edge. Default `1`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| BroomDissolve | `broom-dissolve` |  |  |  |

## Usage

Sweep the cart item away, then clear the row.

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

```tsx title="cart-line.tsx"
"use client";

import { useState } from "react";

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

export function CartLine({ onCleared }: { onCleared: () => void }) {
  const [clearing, setClearing] = useState(false);
  return (
    <div className="flex w-96 max-w-full items-center justify-between gap-4">
      <BroomDissolve
        src="/photos/coffee-beans.webp"
        alt="A bag of coffee beans"
        dissolved={clearing}
        force={1.2}
        onDissolveEnd={onCleared}
        className="w-36"
      />
      <Button variant="destructive" size="sm" onClick={() => setClearing(true)}>
        Clear cart
      </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/broom-dissolve
```

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

- [Magnet Dissolve](https://gelatinui.com/components/magnet-dissolve.md)
- [Dust Dissolve](https://gelatinui.com/components/dust-dissolve.md)
- [Scan Dissolve](https://gelatinui.com/components/scan-dissolve.md)
- [Crumple to Delete](https://gelatinui.com/components/crumple-to-delete.md)

## Motion

| Part | Motion |
| --- | --- |
| Out | reactionFloat · 1.8s · the sweep crosses the picture and pushes the grains off the far edge |
| Back | reactionFloat · 1.8s · the pile slides back and spreads into place |
