DeleteButton
Deletes the current record (confirm-gated).
Installation
pnpm dlx shadcn@latest add @chelone/delete-buttonDeletes the current record (confirm-gated).
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | |
| confirmColor | "primary" | "warning" | — | |
| confirmContent | ReactNode | — | |
| confirmTitle | ReactNode | — | |
| label | string | — | |
| mutationMode | MutationMode | — | `"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. |
| onClick | ReactEventHandler<HTMLButtonElement> | — | |
| record | LooseRecord | — | |
| redirect | false | "list" | "show" | "edit" | — | |
| ref | Ref<HTMLButtonElement> | — | |
| resource | string | — | |
| size | "default" | "sm" | "lg" | "icon" | — | |
| variant | "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | — |