DocsHover & overlays
Get started

Search Subtly documentation

Search by a task, helper name or framework.

Hover & overlays

tooltipGroup()

Show hints on toolbar buttons.

Try the example

Hover a formatting button. The first hint waits 500 ms; moving to a neighboring button shows its hint immediately. Keyboard focus always shows the hint immediately.

Good writing starts with a small idea.

Hover or focus a formatting button.

Actual npm package · local demonstrationHover timing needs a desktop pointer

Add it to your project

  1. Copy the HTML. Place the markup inside the component where this behavior belongs. The preview’s visual classes are website styles; use your own design system.
  2. Connect the behavior. Copy the JavaScript tab and call its exported mount(element) after your component’s elements exist. Replace simulated delays and data operations with your own application code.
  3. Clean up. Call the returned cleanup when the component unmounts. It aborts the example’s listeners and releases the helper’s timers, observers or state.

API and lifecycle

Share one timing instance across neighboring tooltip triggers. enter(key, show, hide) opens the chosen tooltip; the initial delay is 500 ms, followed by a 300 ms warm period for adjacent hints.

Interface
delay=500, cooldown=300; enter(key,show,hide,{immediate}), leave(key), destroy
Lifecycle
leave(key) cancels or closes the matching tooltip. Pass immediate:true for keyboard focus. destroy() clears timing state and closes the current tooltip.

Accessibility and safety

Implementation notes

Timing only: provide accessible descriptions, Escape and hoverable tooltip content when required.

The helper controls timing only. Your tooltip needs an accessible description, Escape behavior where appropriate, and content that stays reachable when hover is required.

What to check

Hover the first trigger, move to its neighbor and compare the delay. Focus a trigger with the keyboard and verify the hint appears immediately and can be dismissed.