Vibe Design Tips

सही डिले से होवर और स्विचिंग को स्वाभाविक बनाएँ

Hover Timing

सही डिले से होवर और स्विचिंग को स्वाभाविक बनाएँ

इंटरैक्शनमोशन

होवर डिले को यूज़र की मंशा के अनुसार तय करें: ग्रुप में वॉर्म स्टार्ट, परत में जाने की गुंजाइश, आकार के हिसाब से गति और कैस्केड मेन्यू में ग़लत स्विच से बचाव।

होवर डिले कोई एक तय, हार्ड-कोडेड मान नहीं होना चाहिए—बहुत छोटा हो तो कर्सर रास्ते में आने वाली हर चीज़ को ट्रिगर कर देता है और पूरी स्क्रीन झिलमिलाने लगती है; बहुत लंबा हो तो इंटरफ़ेस सुस्त लगता है। अच्छे होवर इंटरैक्शन का मूल यही है कि इंतज़ार और चूक की गुंजाइश का समय यूज़र की मंशा के अनुसार बदलता रहे।

ग्रुप में वॉर्म स्टार्ट

जब एक जैसे तत्व पास-पास सटे हों, तो पहले होवर पर 300–500ms का वॉर्म-अप डिले रखें। इससे अनजाने में गुज़रता कर्सर अनदेखा हो जाता है और रास्ते में Tooltip की कतार नहीं चमकती। पहला Tooltip दिख जाए तो साफ़ है कि यूज़र अब जानबूझकर देख रहा है: ग्रुप के भीतर आगे बढ़ने पर इंतज़ार छोड़ दें और Tooltip 0ms में तुरंत दिखाएँ। कर्सर पूरे ग्रुप से बाहर निकलने के लगभग 400ms बाद ग्रुप ठंडा होकर शुरुआती स्थिति में लौट आता है।

  • कहाँ उपयोग करें: टूलबार, अवतार ग्रुप, नीचे का Dock / नेविगेशन बार
  • मान: पहला होवर 300–500ms, ग्रुप के भीतर स्विच 0ms, बाहर निकलने के लगभग 400ms बाद रीसेट

परत में जाने की गुंजाइश

जो इंटरैक्टिव परत होवर पर खुलती है और जिसके अंदर जाकर क्लिक करना होता है, उसे कर्सर के सीमा पार करते ही बंद कर देना सबसे बड़ी ग़लती है। ट्रिगर और परत के बीच के गैप पर एक अदृश्य "पारदर्शी ब्रिज" बिछाएँ, ताकि रास्ते में संपर्क न टूटे; साथ ही कर्सर के परत से बाहर निकलने पर 150–300ms का बफ़र रखें, बड़े प्रीव्यू में इसे 400ms तक बढ़ाएँ। इससे हाथ फिसलने, कर्सर काँपने या बहुत तेज़ चलने से हुई पल भर की चूक माफ़ हो जाती है।

  • कहाँ उपयोग करें: ड्रॉपडाउन मेन्यू, होवर कार्ड (Hover Card), पॉप-अप एक्शन पैनल
  • मान: गैप पर पारदर्शी ब्रिज, बाहर निकलने पर 150–300ms बफ़र, बड़े प्रीव्यू में 400ms

आकार के हिसाब से गति

किसी परत के खुलने की दहलीज़ इस बात के अनुपात में होनी चाहिए कि वह पेज का कितना हिस्सा ढकती है और कितना ध्यान भटकाती है। क्षेत्र जितना बड़ा और जानकारी जितनी भारी, डिले उतना लंबा—परत तभी खुले जब पक्का हो जाए कि यूज़र सच में उसे देखना चाहता है: एक पंक्ति वाले हल्के संकेत (जैसे शॉर्टकट की जानकारी) के लिए पहले नियम जितना ही 300–500ms, प्रोफ़ाइल कार्ड जैसी मध्यम परतों के लिए 500–700ms, और डॉक्यूमेंट प्रीव्यू या रिच मीडिया कार्ड जैसी बड़ी परतों के लिए 700–900ms।

  • कहाँ उपयोग करें: एक पंक्ति वाले Tooltip, लिंक प्रीव्यू के बड़े कार्ड, विवरण वाली परतें
  • मान: हल्के संकेत 300–500ms, कार्ड 500–700ms, बड़े प्रीव्यू 700–900ms

कैस्केड मेन्यू में ग़लत स्विच से बचाव

कैस्केड मेन्यू में जब यूज़र कर्सर को दाईं ओर के सबमेन्यू की तरफ़ ले जाता है, तो रास्ता अक्सर तिरछा होता है और ऊपर-नीचे के पड़ोसी विकल्पों से गुज़रना तय है। रास्ते में आने वाले विकल्पों पर 150–250ms का स्विच डिले जोड़ने से मौजूदा सबमेन्यू बीच रास्ते ग़लती से नहीं बदलता। बिना किसी इंतज़ार के और भी सहज अनुभव के लिए कर्सर की दिशा पर आधारित सेफ़ ट्रायंगल जोड़ें; विस्तार से देखें 002 सेफ़ ट्रायंगल।

  • कहाँ उपयोग करें: मल्टी-लेवल राइट-क्लिक मेन्यू, कैस्केड कैटेगरी नेविगेशन, नेस्टेड परतें
  • मान: स्विच डिले 150–250ms, अगला कदम सेफ़ ट्रायंगल

AI को सौंपें

नीचे दिया Prompt Claude Code, Codex, Cursor, WorkBuddy जैसे किसी AI टूल में कॉपी करें; वह ऊपर के चार नियमों के आधार पर आपके प्रोजेक्ट के होवर इंटरैक्शन की जाँच करेगा और उन्हें बेहतर बनाएगा।

Promptइसे Claude Code, Codex, Cursor या WorkBuddy जैसे किसी Agent में पेस्ट करें
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.

2. Reading the pointer
- Keep the pointer's last few positions and work out its speed over the last 90ms. It is moving fast above about 0.1px per ms (10px in 100ms); below that it is slowing down or resting.
- Waiting to open: the timer starts when the pointer enters a trigger and starts again whenever it enters another one, so a pointer passing over a row of triggers opens nothing.
- Swapping while open: another trigger takes the open card or preview only after the pointer has been slow on it for about 60ms (about 100-150ms after it stops). Triggers crossed fast are passed over.
- When the panel sits to one side and the person may move at an angle across other triggers, the speed check is usually enough. If it is not, add a safe triangle from the pointer to the panel's near edge, as for cascading menus.
- All timers run on one clock, are cancelled when the pointer moves on, and are cleared when the component unmounts. Only one overlay of each kind is open at a time.

3. Rules for every one
- Motion: a label fades in over about 140ms and out over 60ms; a card fades in with a 4px drop over about 200ms and out over 120ms; a preview fades in with an 8px slide over about 250ms and out over 140ms. Swaps in place cross-fade over about 200ms. Closing is always faster than opening.
- Nothing around the trigger moves when an overlay opens or closes.
- Keyboard: focus on a trigger shows its label at once; a card or preview opens on Enter or after the same delay as hover; Escape closes it and returns focus to the trigger. Labels are linked with aria-describedby.
- Touch has no hover. Under @media (hover: none), labels show on long press or as visible text, and cards and previews open on tap. Keep :hover styles inside @media (hover: hover), so a tapped button does not stay in its hover look.
- Reduced motion: no drop, slide or scale; fades only.
- If the product uses a library, set its own options rather than adding timers next to it. For example: Radix Tooltip.Provider delayDuration 500 and skipDelayDuration 400; Radix HoverCard openDelay 700 and closeDelay 300; Floating UI useHover with delay { open, close } and handleClose: safePolygon() for cards and previews, and useDelayGroup for labels.

4. The report
Before changing anything, give me one table, one row per place:
| Place | Kind (label, card, preview, or click instead) | Today (open delay, close, gap, moving to the next) | Problem | Change | Values |
Then list the shared changes (a hover-intent helper, the library settings) separately from the per-place ones. Ask me which rows to change, and change only those.

5. Check the result
- Sweeping the pointer across a toolbar opens no labels; resting on one opens it after 500ms; moving along the toolbar changes it at once, in place, with no flicker; leaving for more than 400ms brings the wait back.
- A card opens after 700ms, and the pointer can cross the gap and press a button inside it. Slipping out of the card and back within 300ms keeps it open.
- Moving at an angle from a list to its preview, across other rows, never changes the preview. Resting on another row swaps it in place, without closing.
- Touch and keyboard reach everything that hover reaches.