999 Design Tips · 025 选用正确的延时,让你的悬停与切换更加人性化 悬停延时的核心,是根据「用户意图」动态响应: 1. 组内“热启动”(工具栏、头像组) 首次悬停设 300–500ms 延时,防止光标路过时闪出一排 Tooltip;一旦触发首个,说明用户进入浏览状态,组内连续切换应 0ms 即时显示。 2. 移入容错(下拉菜单、资料卡) 触发器与浮层的缝隙需加透明桥接区,防止半路断触;光标移出浮层保留 150–300ms 缓冲,避免光标抖动或移速过快打断操作。 3. 按体量定快慢 遮挡面积越大、信息越重(如预览大卡),触发延时应越久(500ms+);单行轻量提示则可更快响应。 4. 级联防误触(多级菜单) 途经其他选项时需加 150–250ms 切换延时,避免光标斜向移往子菜单时误切浮层。更丝滑的做法是加入「安全三角区」,详见我的教程 02 期。 附带一个 Prompt,可基于这套规则帮你快速排查与优化悬停交互,直接抄 ⬇️ https://vibedesign.tips/
枯白啃设计

图标设计师 / 设计工程师

Prompt(1/2) Prompt Review everything in my product that opens on hover, and decide for each one how long it waits before it opens, how long it stays once the pointer leaves, and what happens when the pointer moves on to the next one. Then, if I want it, change the ones I approve. This is about judgment first: diagnose and recommend, and change only what I approve. This is a change to my product, not a demo. Work inside my code, on my stack, with my components, tokens and motion. Do not add a dependency without asking. Every value below is a default to start from. The rule behind all of it: the larger an overlay is, the more of the page it covers and the more there is to click inside it, the longer it waits before it opens and the longer it stays when the pointer leaves. Once the person has shown they want to look, stop making them wait. 0. Read the product first - Find everything that opens on hover: tooltips on icon buttons and on cut-off text, hover cards (people, links, mentions, tags), previews (a document or file beside a list, a link preview, an image enlarged on hover, a panel that opens from a navigation item), and menus or submenus that open on hover. - For each one, note: what triggers it and how close the triggers sit to each other (a toolbar, a row of avatars, a list); how big the overlay is and what it covers; whether there is anything to click inside it; how far it sits from its trigger; and how it is timed today (no delay, one fixed delay, its own timers, a library's defaults). - Find the shared pieces: a Tooltip, HoverCard or Popover component, the library behind them if any (Radix, Floating UI, Headless UI, MUI, Ant Design, a hand-written hook), the timers they use, and how touch and keyboard are handled. - Tell me in a few lines what you found before going on. 1. Sort each one by size a. Label: a tooltip. A few words, nothing to click. - Opens after the pointer has rested on the trigger for 500ms. Moving to another trigger starts the wait again. - Once one label is showing, moving to a neighbour shows its label at once. While the pointer is still inside the group (a toolbar, including the gaps between buttons), the label moves to the new trigger and changes its text in place: no fade out and back. - Leaving the group hides it at once. For 400ms after that, the next label in the group still shows at once; after that, the 500ms wait is back. - Pressing the trigger hides its label, and it does not show again until the pointer has left that trigger. b. Card: a hover card with buttons or links in it (Follow, Message, Open). - Opens after 700ms on the trigger. - Leaving the trigger or the card starts a 300ms grace time; coming back within it keeps the card open. - The gap between the trigger and the card counts as the card: cover it with an invisible area as wide as the card, so crossing it never starts the grace time. - While a card is open, resting on another trigger of the same kind swaps the card's content in place (see 2): the card slides to its new trigger and its content cross-fades; it does not close and open again. - Escape or a click outside closes it at once. c. Preview: a large panel that covers part of the page (a document beside a list, a link or file preview). - Opens after 900ms on the trigger. - Leaving starts a 400ms grace time. The list, the panel and any gap between them all count as inside. - Rows the pointer crosses quickly on its way to the panel do not count (see 2); resting on another row swaps the panel's content in place. d. Should not open on hover at all: anything whose main job is an action, anything that needs typing, and menus that are a choice rather than a glance. Open those on click, and say which ones these are. Pick the kind by what the overlay is, not by what component it uses today: a "tooltip" with a button in it is a card.
登录并发表评论

评论 · 0