Destructive account actions
Make destructive actions understandable before they happen.
Replace habitual confirmation dialogs with readbacks, typed acknowledgements and recovery windows that match the consequence of the action.
A small safety layer for one real flow.
- View component
Type to Confirm
Requires a deliberate typed acknowledgement for irreversible actions.
- View component
Account Deletion Readback
Names what will be removed before an account is deleted.
- View component
Undo Toast
Leaves a short, visible recovery path after a reversible change.
Integration recipe
A starting point for your flow.
import { TypeToConfirm } from "@/components/ui/type-to-confirm"
<TypeToConfirm
open={confirmOpen}
onOpenChange={setConfirmOpen}
phrase="DELETE workspace-name"
description="This removes the workspace and its projects."
onConfirm={() => deleteWorkspaceOnServer(workspaceId)}
/>Server boundary: Typed confirmation helps prevent accidental activation; it is not authorization. Re-check the actor, workspace scope, and deletion policy on the server.
One command for this flow
Install the danger-zone pack.
Start with the related components, then edit the copied source in your own product.
npx shadcn@latest add @bollard/danger-zone-packFallback: add the namespace by hand
Only if npx shadcn@latest add @bollard/… cannot resolve the namespace. Merge this into components.json, then run the same add command. The official shadcn registry index already lists @bollard.
{
"registries": {
"@bollard": "https://bollard-ui.vercel.app/r/{name}.json"
}
}