Search documentation

Search the documentation and open a page.

Displays contextual information when an element is hovered or focused.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/tooltip

Composition

<app-tooltip> ├── [appTooltipTrigger] └── <app-tooltip-content> └── generated portal and positioner └── generated content ├── label content └── generated arrow and arrow tip

Examples

Default

Loading...

Long Label

Loading...

Side

Loading...

With Shortcut

Loading...

API Reference

<app-tooltip>

Inputs

InputTypeDefaultDescription
idstring | undefinedgeneratedUnique identifier used to create the tooltip part IDs.
idsPartial<TooltipElementIds> | undefined—Overrides the generated IDs for individual parts.
openboolean | undefined—Open state when controlled. Supports Angular two-way binding.
defaultOpenbooleanfalseInitial open state when uncontrolled.
disabledbooleanfalseDisables interaction with the tooltip.
openDelaynumber | undefined400Delay in milliseconds before opening.
closeDelaynumber | undefined150Delay in milliseconds before closing.
closeOnPointerDownboolean | undefinedcloseOnClickCloses when the pointer is pressed on the trigger.
closeOnEscapeboolean | undefinedtrueCloses when Escape is pressed.
closeOnScrollboolean | undefinedtrueCloses when the document scrolls.
closeOnClickboolean | undefinedtrueCloses when the trigger is clicked.
interactiveboolean | undefinedfalseAllows pointer interaction with the tooltip content.
positioningTooltipPositioningOptions | undefinedbottom placementConfigures floating placement and collision handling.
aria-labelstring | undefined—Accessible label used by the tooltip content.
triggerValuestring | null | undefined—Active trigger value when controlled. Supports two-way binding.
defaultTriggerValuestring | null | undefined—Initial active trigger value when uncontrolled.

Use [(open)]="open" or [(triggerValue)]="triggerValue" for two-way binding.

Outputs

OutputTypeDescription
openChangeboolean | undefinedEmits the current open state.
triggerValueChangestring | null | undefinedEmits the current active trigger value.
openChangeDetailsTooltipOpenChangeDetailsEmits details whenever the open state changes.
triggerValueChangeDetailsTooltipTriggerValueChangeDetailsEmits details whenever the active trigger changes.

[appTooltipTrigger]

Inputs

InputTypeDefaultDescription
valuestring | undefined—Identifies this trigger when multiple triggers exist.

Context, Providers, and Utilities

ExportAngular API
TooltipRootProviderDirective that provides an externally created tooltip API through value.
TooltipContextStructural directive [tooltip-context] exposing the root API to a template.
useTooltip(options)Creates the signal-backed tooltip machine inside an injection context.
injectTooltipContext()Injects the nearest tooltip root context.
injectTooltipContextCarrier()Injects the carrier used to preserve context through the content portal.
injectTooltipRenderStrategyContext()Injects the nearest lazy-mount and unmount render strategy.
TooltipImportsReadonly collection containing the tooltip UI and context helpers.

Types

ExportDescription
TooltipApiConnected tooltip state and actions.
TooltipElementIdsOverrides for generated tooltip part IDs.
TooltipPlacementSupported floating-content placements.
TooltipPositioningOptionsFloating placement and collision options.
TooltipTriggerPropsProps used to identify a tooltip trigger.
TooltipOpenChangeDetailsDetails emitted by openChangeDetails.
TooltipTriggerValueChangeDetailsDetails emitted by triggerValueChangeDetails.
TooltipRenderStrategyContextLazy-mount and unmount settings for tooltip content.
UseTooltipOptionsOptions accepted by useTooltip.
UseTooltipPropsRoot props accepted by the tooltip machine.
UseTooltipReturnSignal-backed tooltip machine returned by useTooltip.