Destructive Action Safety

React Danger Zone & Destructive Confirmation

Danger zone components replace generic 'Are you sure?' dialogs with explicit typed acknowledgements, deletion readbacks, and recovery windows. They eliminate habitual autopilot confirmation clicks on irreversible actions.

Danger zone kit

Deletes, transfers and resets that need a deliberate second look.

pnpm dlx shadcn@4.21.0 add @bollard/danger-zone-pack

Components in Danger zone (55)

React 19+ · Tailwind v4 · shadcn
Agent Action ApproveStyled

A review screen for an AI agent's tool call that spells out what it will delete, send or change and how far it reaches, before someone approves it.

Stops: Unreviewed agent tool calls
Undo ToastStyled

Runs actions optimistically and commits only after an undo window, so a mistake can be taken back without an "Are you sure?".

Stops: Deleted item gone with no undo
Reset Hard ReadbackStyled

Lists exactly what git reset --hard, clean, checkout -- . or stash drop would destroy, and offers to stash first.

Stops: Uncommitted work wiped by git reset
Account Deletion ReadbackStyled

Reads back everything an account deletion loses or keeps charging for, so users do not delete more than they expect or keep paying an app store.

Stops: Deleted account still billing subscriptions
Force Push ConfirmStyled

Lists every commit a force push would drop, marks other people's work and builds a safer lease command, so teammates' commits aren't erased.

Stops: Teammates' commits erased by force push
Infra Plan ReadbackStyled

Reads a Terraform or OpenTofu plan back with data-losing destroys and replacements first, so an apply doesn't quietly delete a production database.

Stops: Helps prevent terraform apply destroying a production database
Migration PreviewStyled

Reads a Postgres migration back step by step with what each step locks and what can't be undone, so it doesn't take production down or lose data.

Stops: Helps prevent a migration locking a production table for hours
Hold to ConfirmStyled

A button that fires only after a full press-and-hold, so a stray click or tap doesn't trigger a destructive action.

Stops: Helps prevent a destructive action fired by a stray click
Two-Step ButtonStyled

Needs two deliberate clicks for a destructive action: the first arms it with a draining timer, the second confirms.

Stops: One click deleted without confirmation
Type to ConfirmStyled

Confirmation dialog that unlocks a destructive action only after the exact name is typed, flagging a typo as it happens.

Stops: Wrong repo deleted on reflex
Impact PreviewStyled

Before a delete, loads and lists everything that goes with the parent object, so a cascade doesn't wipe child records nobody saw.

Stops: Helps prevent a cascade delete wiping child records
Bulk Scope ConfirmStyled

States exactly how many records a bulk action will hit and defaults to this page only, so "select all" doesn't hit every record.

Stops: Bulk action hit every record
Drop ConfirmStyled

A drop target that names what will move and where, ignores flick drops and offers Undo, so files and folders don't land in the wrong place.

Stops: Folder dropped into wrong place
Danger ZoneStyled

Keeps destructive settings visible but locked until deliberately unlocked, so a stray click doesn't delete or transfer something.

Stops: Stray click deleted from settings
Click ShieldStyled

Ignores clicks on a button for a moment after it appears, moves or changes, so people don't press something that just slid under the cursor.

Stops: Clicked button that just appeared
Shortcut ConfirmStyled

Makes a destructive keyboard shortcut need a deliberate second press, so a slipped finger only shows a prompt.

Stops: Keyboard shortcut deleted items
Guarded SwitchStyled

Puts a lift-up cover over a critical switch like maintenance mode or a kill switch, so a stray click can't flip it.

Stops: Helps prevent a kill switch flipped by accident
Swipe Delete RowStyled

Makes swipe-to-delete deliberate: the row deletes only past a visible line, never on a flick or scroll, and keeps an Undo.

Stops: Swipe while scrolling deleted row
Two-Person ApproveStyled

Review screen for the two-person rule: it shows the exact plan, hides Approve from the requester, and flags edits made after review.

Stops: Helps prevent a requester approving their own risky change
Trash CountdownStyled

Shows how long each trashed item has before it's deleted forever, and makes emptying the trash need the typed item count.

Stops: Trash purged before anyone restored
Range Select GuardStyled

Reads back how many rows a shift-click just selected, with Undo, so a runaway range selection doesn't act on rows nobody saw.

Stops: Shift-click selected thousand rows
Reauth GateStyled

Asks the user to re-confirm with a passkey, password or PIN before a sensitive action, so an unattended signed-in screen is harder to misuse.

Stops: Helps prevent a sensitive action on an unattended signed-in screen
Rollback PreviewStyled

Shows what a rollback reverts, what it can't undo and which versions it skips, then confirms by typing the target's name.

Stops: Rollback skipped more versions than expected
Archive or DeleteStyled

Puts Archive and Delete side by side with what happens to each thing under both, so people don't delete what they only meant to put away.

Stops: Deleted forever instead of archived
Revoke Access PreviewStyled

Shows what removing a member, token or app will break: owned work left unowned, sessions ended and integrations that stop.

Stops: Removed member's integrations stopped working
Transfer OwnershipStyled

Reads back what an ownership transfer moves and keeps, warns about an outside email or a recipient whose plan can't own it, and waits for acceptance.

Stops: Ownership transferred to the wrong email
Merge RecordsStyled

Before merging duplicate records, names every value that will be discarded, so a merge doesn't silently throw data away.

Stops: Duplicate merge discarded customer data
Move ReadbackStyled

Before moving an item, reads back who gains or loses access, which links break and which settings change, so a private doc doesn't land in a public folder.

Stops: Helps prevent a private doc being moved into a public folder
Reset PreviewStyled

Shows only the settings a reset would actually change, current → default, so a reset to defaults doesn't wipe customisations unseen.

Stops: Reset to defaults wiped customizations
Replace FileStyled

Helps prevent an upload from overwriting a newer file with an older one by comparing both copies before replacing.

Stops: Older upload overwrote newer file
DNS Record GuardStyled

Checks a DNS edit or delete against the whole zone before saving, so a removed MX or broken SPF doesn't quietly stop company email.

Stops: Deleted MX record stopped company email
Key RotateStyled

Keeps old and new API keys valid during a rotation and shows which clients have switched, so cutting off the old key doesn't take production down.

Stops: Helps prevent a key rotation taking production down
Retention ChangeStyled

Says exactly what a shorter data-retention period will delete and when, and suggests an export before it purges.

Stops: Shorter retention purged months of data
Bulk RunnerStyled

Runs a bulk job with live done, failed and remaining counts, so a stopped or failed job never ends in "some of it happened, probably".

Stops: Bulk job half done, nobody knows
Email Change GuardStyled

Catches typos in a new account email and keeps the old address active until the new one is verified, so nobody locks themselves out.

Stops: Locked out by a typo'd new email
Paste Target GuardStyled

Compares a pasted IBAN, UPI ID or wallet address with what was copied or expected, so a clipboard hijacker's swapped address is caught before paying.

Stops: Helps catch a clipboard hijacker swapping the payee address
Mixed Value FieldStyled

In a bulk edit, shows "Mixed (3 values)" with the spread instead of a blank, so saving doesn't silently overwrite every record.

Stops: Bulk edit overwrites every record
Scope PickerStyled

Reads back what an API key will be able to do in plain words, flags risky scopes and suggests trimming to what was actually used.

Stops: API key with admin powers leaks
Package Name CheckStyled

Reads an npm or pip install command package by package and flags typosquats, wrong import names and packages that don't exist yet.

Stops: Helps catch a typosquatted package before install
Curl Pipe GuardStyled

Shows where a curl | sh install script really comes from and offers download, inspect and verify steps instead, before an untrusted script runs.

Stops: Ran an untrusted install script
Port Expose GuardStyled

Reads docker run, compose ports or a Kubernetes Service back as who can reach each port, so a database isn't published to the internet by accident.

Stops: Helps prevent a database port being opened to the internet
Chmod InputStyled

Reads a Unix file mode back in plain words and flags permissions that leak data or lock people out, like a world-readable key.

Stops: World-writable file or exposed key
Public Env GuardStyled

Reads a .env the way the bundler does and flags secrets in public variables, so a secret key isn't shipped in the client bundle.

Stops: Helps catch a secret key shipped in the client bundle
CIDR InputStyled

Reads a CIDR block back as its exact range and size, and warns before a firewall rule opens to the whole internet or overlaps an existing range.

Stops: Firewall opened to 0.0.0.0/0
SQL GuardStyled

Warns before running SQL that touches every row or drops data, like UPDATE/DELETE without WHERE, and asks for the table name first.

Stops: Helps catch a DELETE without WHERE before it runs
Kube Context GuardStyled

Shows the cluster, context and namespace a kubectl or helm command will really hit, before it runs, so production isn't changed by accident.

Stops: Helps prevent kubectl apply on the wrong cluster
Environment BadgeStyled

Marks the page, tab title and favicon with the environment, so nobody edits production thinking it is staging.

Stops: Edited production thinking it was staging
Acting As BannerStyled

A sticky bar that says whose account you are acting as, and labels destructive buttons with the org they act on, so support staff don't edit the wrong data.

Stops: Edited a customer's data as myself
Bulk Send GuardStyled

States who an SMS, WhatsApp or email blast will reach, who is excluded and who is in quiet hours, before an explicit confirm sends it.

Stops: Bulk blast sent at 2 AM
Role PreviewStyled

Shows what a chosen role can and can't do, the diff from the current role, and a smaller role when the pick adds risky permissions.

Stops: Gave a teammate admin by mistake
Visibility PickerStyled

Makes widening who can see something an explicit step that shows who gains access; narrowing stays instant.

Stops: Made a private doc public by accident
Plan Change ReadbackStyled

Before an upgrade or downgrade, reads back today's charge, credits, the next bill and any usage over the new plan's limits, so nobody is surprised by a charge or lost data.

Stops: Downgrade deleted data over the limit
Workflow YAML GuardStyled

Flags GitHub Actions workflow patterns that can expose secrets or the repo to pull requests, following GitHub's secure-use guidance.

Stops: Helps catch workflows that could leak repo secrets to a pull request
IAM Policy CheckStyled

Reads an AWS IAM or S3 bucket policy back in plain words and flags grants far wider than intended, such as a bucket made public.

Stops: Helps catch an S3 bucket made public by a policy
Dedupe Key PickerStyled

Previews how many rows a dedupe would merge as you pick key columns, so it doesn't merge nothing or merge too much.

Stops: Dedupe merged the wrong rows

Frequently Asked Questions about Danger zone Guardrails

Why are standard 'Are you sure?' confirm dialogs ineffective for destructive actions?

Users develop confirmation fatigue and automatically click OK without reading the prompt text. Use Type to Confirm (`type-to-confirm`) to require typing the resource slug. Install with `npx shadcn@4.21.0 add @bollard/type-to-confirm`. Limitation: typed input is a UI guard, not permission authorization.

How do I prevent stray clicks on high-risk admin buttons?

Hold to Confirm (`hold-to-confirm`) requires pressing and holding the button for 2-3 seconds before triggering. Install with `npx shadcn@4.21.0 add @bollard/hold-to-confirm`. Limitation: long presses can be simulated by automated scripts.

How do I provide a safe undo window after deletion?

Undo Toast (`undo-toast`) delays permanent deletion by 5 to 10 seconds, allowing users to cancel an accidental click. Install with `npx shadcn@4.21.0 add @bollard/undo-toast`. Limitation: requires soft-delete or staging queues on the backend.

How do I clearly display which resources will be affected by a destructive action?

Account Deletion Readback (`account-deletion-readback`) itemizes deleted workspaces, members, and data before confirming. Install with `npx shadcn@4.21.0 add @bollard/account-deletion-readback`. Limitation: actual cascade deletion logic belongs in database transactions.