Skip to content
Sign upGet access
MicrointeractionsMessage deleteMenu

Message delete

Deleting a message without a hole: it blurs away into a slim note with a draining Undo.

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

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/message-delete.json

Usage

tsx
import { MessageDelete } from "@/components/ui/chatcn/message-delete"

<MessageDelete deleted={deleted} onUndo={() => setDeleted(false)} onGone={() => remove(message.id)}>
  <Bubble>{message.text}</Bubble>
</MessageDelete>

Props

PropTypeNotes
deletedbooleanTurning it on plays the delete
onUndo() => voidShows Undo
onGone() => voidAfter the note has folded: remove it for good here
undoMsnumberDefault 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.