Toast 和 Notification 怎么选? 在网页端,尤其是给操作反馈时,我们常用 Toast 或 Notification 传递信息。两者的使用场景有什么区别? Toast 用于即时、直接的反馈:展示某个操作的结果,用户知道即可。它可以附带一个按钮(比如撤销),配合倒计时,到时自动消失,避免打扰。耗时的操作,也可以先显示进度,完成后原地变为结果。 如果某件事必须由用户处理,就不适合用 Toast:不可撤销的操作,应在执行前用弹窗确认;需要处理的失败,应留在原处,直到解决。 Notification 常见于操作系统,一些工作台类产品也会使用。它与 Toast 最大的区别在于:内容可以与用户当前的操作无关,由他人或系统主动发出,而不是由用户的操作触发。因此,它适合展示需要用户看到、但不必立刻打断的信息,这也是它与弹窗的区别。Notification 会一直保留,直到用户处理或关闭;多条可以堆叠,也可以附带操作按钮。 附一条 Prompt:它会先读取你的产品,逐条判断每条提示该用 Toast、Notification 还是都不用,列出表格由你决定;确认后,还可以按视频中的效果改造 Toast 和 Notification。完整 Prompt 见评论,可以直接复制。
枯白啃设计

图标设计师 / 设计工程师

Prompt(2/3) - Now: how it is shown today, in a few words. - Should be: status toast, action toast, progress toast, notification, or neither (and which). - Why: one line, using the questions above. - Change: what would change (kind, wording, buttons, how long it stays, where it is kept). Mark the ones that are already right. Mark the ones that could go either way and say what decides between them, as a question for me. Then list anything missing: an action that should offer Undo, a failure that only shows a toast, a background job that never says it is done, news with no place to find it again. Then ask me which rows to change and wait. 4. Optional: restyle the toast and the notifications After the table, offer these as a separate choice, and wait for my answer: A. Restyle the toast only. B. Restyle the notifications only. C. Both. D. Neither; just fix the kinds and wording. For each one I pick, show me a short before and after (values and motion), in my product's own colours and corners, and wait for my go-ahead before building. 4A. Toast - Place: the top centre of the page, 12 under the top bar, over the content. One at a time. - Shape: 40 tall, 16 corners (or the nearest step in my corner scale), a white surface with a soft top-to-bottom gradient (#ffffff to #f7f9fc), a 1px border rgba(214, 219, 227, 0.95), and a soft shadow (0 16px 36px rgba(17, 24, 39, 0.08), 0 3px 10px rgba(17, 24, 39, 0.05)). Inner shapes are concentric with it: the icon, 8 in, is 24 with 8 corners; a button or the close, 6 in, is 28 with 10 corners. - Content: icon, then one line of 14/20 text, then the button and the close if there are any. The done icon is a check on a soft tile in my accent colour; work in progress is a ring; the time left to undo is a ring that empties, with the seconds in its centre. The button is accent-coloured text, with a tint only on hover. Keep the gaps tight: 8 between the icon and the text, the button and the close next to each other. - Enter: in 500ms on cubic-bezier(0.25, 0.1, 0.25, 1), the whole toast comes down from 10px above, grows from 96% and clears from an 8px blur; it is fully opaque a little before the end. Text and controls move with it as one piece, not letter by letter. - Leave: 220ms, ease-in: up 6px, blur 6px, fade out. - Sheen: a light band crosses it once (900ms, ease-out) only when something is done: a status toast as it enters, a progress toast as it turns into its result, an Undo toast after Undo. An action toast that still waits for a choice enters without it. - Change in place (progress to result, archived to restored): the old line (text, button and close together) blurs out and moves 5px up in 180ms; the new line blurs in from 5px below between 100 and 400ms; the toast takes its new width in 380ms on cubic-bezier(0.32, 0.72, 0, 1). Only the icon has a move of its own: the old one shrinks and blurs away while the new one turns in from -40 degrees and half size. - After Undo: the change is reverted, and the toast says so ("Task restored") for about 1.5 seconds before it leaves. - Timing: a status toast stays 3 to 5 seconds, longer for longer text; an action toast at least 5 seconds; a progress toast stays while the work runs, then 3 seconds. The timer pauses while the pointer is over the toast or focus is inside it. 4B. Notifications - Place: the top right, 12 under the top bar, the same on every page, above the content. 344 wide. - Card: 24 corners with 12 of padding, so the picture (32, a person's photo or the product's logo) and the buttons (32 tall, 12 corners) are concentric with it. A title (14/20, semibold) with the time on the right, up to three lines of 13/20 text, then up to two buttons on the bottom right, the main one last. - A stack: the newest is in front. The older ones are cut to the front one's height and peek out 12 below it, at 95% and 90%, showing only their edge; at most three show. - A new one arrives: it slides down onto the stack from 56px above in 560ms on cubic-bezier(0.32, 0.72, 0, 1), clearing from a light blur, while the others are pushed down and back a step. The one it covers keeps its content until the new one is on its way over it, so it reads as stacking, not replacing.
登录并发表评论

评论 · 0