DeleteButton

Deletes the current record (confirm-gated).

Installation

pnpm dlx shadcn@latest add @chelone/delete-button

Deletes the current record (confirm-gated).

Props

PropTypeDefaultDescription
classNamestring—
confirmColor"primary" | "warning"—
confirmContentReactNode—
confirmTitleReactNode—
labelstring—
mutationModeMutationMode—`"undoable"` deletes optimistically with an Undo notification (no confirm dialog): the record vanishes now, the list redirect happens immediately, and the server call is deferred until the Undo window closes. Default (`"pessimistic"`) is confirm-gated.
onClickReactEventHandler<HTMLButtonElement>—
recordLooseRecord—
redirectfalse | "list" | "show" | "edit"—
refRef<HTMLButtonElement>—
resourcestring—
size"default" | "sm" | "lg" | "icon"—
variant"link" | "default" | "destructive" | "outline" | "secondary" | "ghost"—