Tooltip directive provides advisory information for a component. Tooltip is integrated within various PrimeNG components.
import { TooltipModule } from 'primeng/tooltip';Position of the tooltip is specified using tooltipPosition attribute. Valid values are top, bottom, right and left. Default position of the tooltip is right.
Tooltip gets displayed on hover event of its target by default, other option is the focus event to display and blur to hide.
Tooltip is hidden when mouse leaves the target element, in cases where tooltip needs to be interacted with, set autoHide to false to change the default behavior.
Adding delays to the show and hide events are defined with showDelay and hideDelay options respectively.
Tooltip can use either a string or a TemplateRef.
Tooltip is also configurable by using tooltipOptions property.
Tooltip component uses tooltip role and when it becomes visible the generated id of the tooltip is defined as the aria-describedby of the target.
| Key | Function |
|---|---|
| escape | Closes the tooltip when focus is on the target. |