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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CrumpleToDeleteItem
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| on | — | Called when the Undo window ends with the ball still in the bin: remove the data now. | |
| on | — | Called when Undo is pressed: the card comes back. | |
| disabled | boolean | false | Stops new deletes. A ball in the air still lands. |
| undo | "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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CrumpleToDeleteTrigger
<button>| 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" | — | |||||
| class | 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. | ||||
| spinner | "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 | |||||||
| focusable | boolean | false | Whether 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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CrumpleToDeleteUndo
<button>| 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" | — | |||||
| class | 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. | ||||
| spinner | "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 | |||||||
| focusable | boolean | false | Whether 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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CrumpleToDeleteBin
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Tab | Moves the focus to Delete, and to Undo while the ball is in the bin. |
|---|---|
| EnterorSpace | 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. |
Built with
Installs with Crumple to Delete
- Components
- Button













