NIB / DOCUMENTATION
Hover card — NibComponents
Reveal extra context after hover intent, with a path for touch and keyboard users.
Open interactive viewShow supplemental context
Use a hover card for a contributor summary or link preview. Keep essential instructions in the page: touch screens have no hover and users may never pause over a trigger. The example also opens from a button and provides a close action.
NibHoverCard requires content and normally has a trigger. NibHoverCardController permits an external action to open, close, or toggle it. The complete example’s NibButton calls that controller, so keyboard activation does not depend on a mouse event.
Separate intent from crossing the gap
showDelay defaults to 700 milliseconds; hideDelay defaults to 300. Showing after a delay avoids flicker during a quick pass-over. The hide delay gives the pointer time to cross gap onto the card. Moving onto its content keeps it open. The slider changes real showDelay, not decorative speed.
openOnTap defaults to true and supplies the built-in touch-style toggle. Setting it false removes that fallback, so keep an explicit control if the content matters. The demo’s button drives the controller independently. Pending show/hide timers belong to the widget and are cancelled when it is disposed.
Give the content enough room
NibHoverCardPlacement offers bottom, top, start, and end. The panel flips or clamps as needed; gap and maxWidth control separation and the width ceiling. Keep the content short enough to fit near an edge. A hover card is a poor home for a multi-step form.
The card is anchored to its trigger and captures inherited theme across the overlay boundary. Test the host’s real coordinate space. A bounded local preview and a root application overlay need separate geometry checks.
Keep hover separate from focus
Hovering does not steal focus from the trigger. The card is not a modal focus trap. semanticLabel describes its purpose; the demo’s explicit button and close action provide a path without hover. onOpen and onClose report visibility changes.
Do not place a required confirmation behind a hover-only surface. Use a dialog for an explicit decision. Desktop pointer tests do not establish touch, mobile browser, or screen-reader behavior.
Keep a stable controller
Create NibHoverCardController in State and dispose it there. open, close, toggle, and isOpen describe visibility, not loading state. Without an external controller the widget owns one. The example preserves its controller across property edits.
Load profile data separately. Cancel or ignore an async result if the hovered identity changes or its owner is disposed. This example uses local text and starts no network work or recurring task.
Tune the delay before adding movement
animated is false by default; transition and enterFrom customize optional NibMotion entrance and exit. A longer hover delay and a slower entrance solve different problems. The information must remain usable with reduced motion.
If the card never opens, check its hit area, elapsed showDelay, and whether the pointer left. If it closes while crossing to the panel, check gap and hideDelay together. The regression asserts absence before the deadline and presence after it, plus explicit button behavior and cleanup.