Skip to content

Crumple to Delete

Pro

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.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 11, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Crumple to Delete needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
38
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

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

The sample also uses Card. One command adds them with this item:

notes.tsx

CrumpleToDelete

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CrumpleToDeleteItem

<div>
PropTypeDefaultDescription
onDelete—Called when the Undo window ends with the ball still in the bin: remove the data now.
onUndo—Called when Undo is pressed: the card comes back.
disabledbooleanfalseStops 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.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CrumpleToDeleteSheet

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CrumpleToDeleteTrigger

<button>
PropTypeDefaultDescription
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"—
classNamestring—
busyboolean—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.
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

CrumpleToDeleteDiscarded

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CrumpleToDeleteUndo

<button>
PropTypeDefaultDescription
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"—
classNamestring—
busyboolean—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.
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

CrumpleToDeleteCountdown

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CrumpleToDeleteBin

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • 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.
  • For a delete that needs a confirmation first, use an Alert Dialog.
  • For a short Undo message that is not on the card, use a Toast.
TabMoves the focus to Delete, and to Undo while the ball is in the bin.
EnterorSpaceOn 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.

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.

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

Built with

Installs with Crumple to Delete

Components
Button
  1. AddedCrumple to Delete, with Button.
Open the release