---
title: "Crumple to Delete"
description: "Delete a card by crumpling it into a paper ball that flies into a bin. Flick the ball yourself, and use Undo to pull it back out flat."
url: https://gelatinui.com/components/crumple-to-delete
markdown_url: https://gelatinui.com/components/crumple-to-delete.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/crumple-to-delete"
version: "2026-11-11"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Crumple to Delete

> Delete a card by crumpling it into a paper ball that flies into a bin. Flick the ball yourself, and use Undo to pull it back out flat.

Page: https://gelatinui.com/components/crumple-to-delete

## When to use it

Best for: A delete with Undo where the card itself shows where it went: a note, a draft, a pin, or a task.

- Put one `CrumpleToDeleteBin` in the root, in view of the items. One bin serves every item in the root.
- Remove the data in `onDelete`: it runs only when the Undo window ends with the ball still in the bin.
- Put `CrumpleToDeleteDiscarded` in each item, so Undo shows in the empty place of the card.
- Set `undoWindow="long"` (10 s) when the card holds work that is hard to make again.

## When not to use it

- For a delete that needs a confirmation first, use an [Alert Dialog](https://gelatinui.com/components/alert-dialog.md).
- For a short Undo message that is not on the card, use a [Toast](https://gelatinui.com/components/toast.md).

## Notes for agents

- Each `CrumpleToDeleteItem` has its own machine; many items can fly at once into one bin.
- The item keeps its place in the layout while the ball flies and while Undo shows, so the page does not jump.
- With no bin in the root, the ball hops and sinks into the floor of its own place.
- A hover or a focus the person moves onto the Undo area holds the window; when both leave, the full window starts again.
- The ball rests for 0.6 s after the crumple: grab it and flick it to throw it yourself. A miss hits the rim and drops in.
- Read the item from your own part with `useCrumpleToDeleteItem(name)`: `crumple()`, `undo()`, and `phase`.

## Anatomy

```text
CrumpleToDelete
├─ CrumpleToDeleteItem (0..n)
│  ├─ CrumpleToDeleteSheet (0..n)
│  ├─ CrumpleToDeleteTrigger (0..n)
│  ├─ CrumpleToDeleteDiscarded (0..n)
│  ├─ CrumpleToDeleteUndo (0..n)
│  └─ CrumpleToDeleteCountdown (0..n)
└─ CrumpleToDeleteBin (0..n)
```

## API reference

### CrumpleToDelete

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### CrumpleToDeleteItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `onDelete` | `function` |  | Called when the Undo window ends with the ball still in the bin: remove the data now. |
| `onUndo` | `function` |  | Called when Undo is pressed: the card comes back. |
| `disabled` | `boolean` | false | Stops new deletes. A ball in the air still lands. |
| `undoWindow` | `"long" \| "short"` | "short" | How long Undo stays: `short` 5s (default) or `long` 10s. A hover or a Tab onto it pauses it. |

### CrumpleToDeleteSheet

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### CrumpleToDeleteTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### CrumpleToDeleteDiscarded

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### CrumpleToDeleteUndo

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### CrumpleToDeleteCountdown

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### CrumpleToDeleteBin

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| CrumpleToDelete | `crumple-to-delete` |  |  |  |
| CrumpleToDeleteItem | `crumple-to-delete-item` | `data-phase` |  |  |
| CrumpleToDeleteSheet | `crumple-to-delete-sheet` | `data-phase` |  |  |
| CrumpleToDeleteTrigger | `crumple-to-delete-trigger` |  |  |  |
| CrumpleToDeleteDiscarded | `crumple-to-delete-discarded` |  |  |  |
| CrumpleToDeleteUndo | `crumple-to-delete-undo` |  |  |  |
| CrumpleToDeleteCountdown | `crumple-to-delete-countdown` |  |  |  |
| CrumpleToDeleteBin | `crumple-to-delete-bin` |  | `--crumple-to-delete-bin-size` |  |

## Usage

Put the items and one bin in the root. Remove the data in `onDelete`.

The sample also uses `card`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui-pro/crumple-to-delete @gelatin-ui/card
```

```tsx title="notes.tsx"
import { Card, CardHeader, CardTitle } from "@/components/ui/card";
import {
  CrumpleToDelete,
  CrumpleToDeleteBin,
  CrumpleToDeleteDiscarded,
  CrumpleToDeleteItem,
  CrumpleToDeleteSheet,
  CrumpleToDeleteTrigger,
} from "@/components/pro/effects/crumple-to-delete";

type Note = { id: string; title: string };

export function Notes({ notes, onRemove }: { notes: Note[]; onRemove: (id: string) => void }) {
  return (
    <CrumpleToDelete className="flex items-end gap-8">
      {notes.map((note) => {
        return (
          <CrumpleToDeleteItem
            key={note.id}
            onDelete={() => {
              onRemove(note.id);
            }}
          >
            <CrumpleToDeleteSheet>
              <Card>
                <CardHeader>
                  <CardTitle>{note.title}</CardTitle>
                </CardHeader>
                <CrumpleToDeleteTrigger>Delete</CrumpleToDeleteTrigger>
              </Card>
            </CrumpleToDeleteSheet>
            <CrumpleToDeleteDiscarded />
          </CrumpleToDeleteItem>
        );
      })}
      <CrumpleToDeleteBin>Bin</CrumpleToDeleteBin>
    </CrumpleToDelete>
  );
}
```

## 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/crumple-to-delete
```

It adds 42 registry items: 39 files, 7357 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Button](https://gelatinui.com/components/button.md)

## 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

- [Card](https://gelatinui.com/components/card.md)
- [Button](https://gelatinui.com/components/button.md)
- [Toast](https://gelatinui.com/components/toast.md)
- [Alert Dialog](https://gelatinui.com/components/alert-dialog.md)
- [Kanban](https://gelatinui.com/components/kanban.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves the focus to Delete, and to Undo while the ball is in the bin. |
| Enter, Space | On Delete: crumples the card and throws it in the bin; the focus moves to Undo when it lands. On Undo: brings the card back with the focus on it. |

## Accessibility

Delete and Undo are real buttons. The focus moves to Undo when the ball lands, and back to the card after Undo.

When the window ends, the focus moves on to the next control, not to the top of the page.

## Motion

| Part | Motion |
| --- | --- |
| Crumple | progress · the card folds on a 6 × 5 crease grid into a rough ball in 0.62 s, the corners first |
| Toss | progress · the ball flies a ballistic arc into the bin; a miss hits the rim and drops in |
| Bin bump | reveal · the bin squashes 10% and rocks 4° on a landing, about half on a rim hit |
| Undo | progress · the ball flies back and opens flat in 0.5 s; the creases fade over 1.1 s |
| Undo place | statusPop · the empty place with Undo pops in from 60% and fades out |
