Tooltip overview
Headless tooltip gives you hover and focus helper-text behavior with primitive-owned anchoring, positioning, and ARIA wiring while leaving the trigger and floating shell fully up to you.
Imports
Bring in the root plus the two slot directives when you want full ownership of the markup.
Headless tooltip imports
ts
import {
TngTooltip,
TngTooltipContent,
TngTooltipTrigger,
} from '@tailng-ui/primitives';
Basic composition
The root manages delays and floating placement. Trigger and content stay semantic and owner-authored.
Headless tooltip composition
html
<span tngTooltip side="top" [openDelay]="120" [closeDelay]="60">
<button type="button" tngTooltipTrigger>Hover for hint</button>
<span tngTooltipContent id="country-filter-tip">
Use this to filter countries quickly.
</span>
</span>
Style variants
The same headless tooltip behavior skinned with owner-authored CSS or Tailwind utilities.
Headless tooltip with owner CSS
Headless tooltip stays non-interactive and repositions with collision handling.
open: false
Headless tooltip with Tailwind shell
Tailwind utilities can reskin the surface while the primitive owns placement and ARIA.
open: false
Behavior baseline
mouseenterand keyboard focus open the root-managed tooltip.mouseleave, blur, outside pointer, andEscapeclose the tooltip.- Positioning is computed in JavaScript with side flipping and viewport collision handling.
- Tooltip content stays non-interactive and should remain outside the tab order.