Destructive Action (Danger Button) new 危险操作 Destructive Action(危险按钮) web

Project AtlasShared with 8 teammates

标本可交互,可以直接操作。

Anatomy — every part, named解剖 —— 每个部件的名字

  1. 1 Consequence label后果标签 button text

    The verb and object that make the outcome explicit.

    让结果明确的动词和对象。

    Prompt fragmentPrompt 片段

    a specific label such as Delete project rather than a vague Delete or Remove

    使用 Delete project 这样的具体标签,而不是含糊的 Delete 或 Remove

  2. 2 Confirmation surface确认界面 alertdialog

    The protected context that repeats the consequence and offers a safe exit.

    重复后果并提供安全退出的受保护上下文。

    Prompt fragmentPrompt 片段

    an alertdialog with the item name, consequence, Cancel, and the final destructive action

    alertdialog 中写出项目名、后果、Cancel 和最终危险操作

  3. 3 Undo feedback撤销反馈 toast + action

    The short recovery window after a reversible delete.

    可逆删除后的短暂恢复窗口。

    Prompt fragmentPrompt 片段

    a toast stating Project deleted with an Undo action and a visible timeout

    toast 显示 Project deleted,带 Undo 操作和可见倒计时

Prompt — paste into your agentPrompt —— 直接粘贴给你的代理

Build a destructive action pattern for deleting a saved item. Use a specific verb, explain the consequence before the final action, keep Cancel available and focused by default in a confirmation surface, prevent accidental form submission, expose a disabled/loading state during the request, and offer Undo when the operation can be reversed. Use color as reinforcement, never the only warning.

为删除已保存项目构建危险操作模式。使用具体动词;在最终操作前解释后果;确认界面默认聚焦 Cancel,并保留危险操作;防止误触发提交;请求期间显示禁用或加载状态;操作可逆时提供 Undo。颜色只是辅助警示,不能成为唯一提示。

Debug prompt — when it misbehaves调试 Prompt —— 当它不听话时

Debug my destructive action. Check that the label names the exact consequence; Cancel and the destructive action have an intentional focus order; pressing Enter cannot trigger deletion by accident; loading prevents duplicate requests; errors explain recovery; the danger color meets contrast; keyboard and screen reader users get the same warning; and an undo path appears when the server can restore the item. The symptom:

调试我的危险操作。检查:标签是否写明确切后果;Cancel 和危险操作的焦点顺序是否有意设计;按 Enter 是否会意外删除;加载中是否防止重复请求;错误是否说明恢复方法;危险颜色是否满足对比度;键盘和屏幕阅读器用户是否得到同样警示;服务器可恢复时是否出现撤销路径。症状:

In code代码里叫什么

Framework框架Symbol符号Note说明
ARIA aria-describedby + alertdialog connect the consequence and recovery path把后果和恢复路径连接起来
Web button type="button" never make a destructive action the accidental form submit不要让危险操作意外成为表单提交
UX confirmation + undo match interruption to the reversibility and cost根据可逆性和代价决定是否打断,并匹配撤销
CSS :focus-visible + disabled keep danger, focus, and disabled states distinct让危险、焦点和禁用状态彼此清楚

See also相关词条

我的参考集

组合页面参考、知名网站、UI 元素和视觉风格,导出给 AI。

你的下一份设计,从这里开始。

在任意标本旁点击「加入参考」,就能把页面、品牌、组件和风格组合成一份 AI 设计说明。

浏览页面参考

搜索参考库Search the library

输入关键词,搜索所有参考。