Message delete
Deleting a message without a hole: it blurs away into a slim note with a draining Undo.
On this page
The message washes red and blurs away as its row closes to a slim note; a line under Undo drains while you can take it back, then the note folds shut.
The message washes red and blurs away as its row closes down to a slim Message deleted note, the messages below rising to meet it. A thin line under Undo drains for as long as you can take it back. Undo opens the row again and the message comes back into focus; when the line runs out, the note folds shut and the gap closes.
Installation
Usage
import { MessageDelete } from "@/components/ui/chatcn/message-delete"
<MessageDelete deleted={deleted} onUndo={() => setDeleted(false)} onGone={() => remove(message.id)}>
<Bubble>{message.text}</Bubble>
</MessageDelete>Props
| Prop | Type | Notes |
|---|---|---|
deleted | boolean | Turning it on plays the delete |
onUndo | () => void | Shows Undo |
onGone | () => void | After the note has folded: remove it for good here |
undoMs | number | Default 4000 |
Accessibility
- The note is a status; the deleted message leaves the accessibility tree.
Motion
- Height closes 560 ms while the message blurs out 420 ms. Reduced motion: it swaps to the note.