Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
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
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create the tooltip part IDs. |
ids | Partial<TooltipElementIds> | undefined | — | Overrides the generated IDs for individual parts. |
open | boolean | undefined | — | Open state when controlled. Supports Angular two-way binding. |
defaultOpen | boolean | false | Initial open state when uncontrolled. |
disabled | boolean | false | Disables interaction with the tooltip. |
openDelay | number | undefined | 400 | Delay in milliseconds before opening. |
closeDelay | number | undefined | 150 | Delay in milliseconds before closing. |
closeOnPointerDown | boolean | undefined | closeOnClick | Closes when the pointer is pressed on the trigger. |
closeOnEscape | boolean | undefined | true | Closes when Escape is pressed. |
closeOnScroll | boolean | undefined | true | Closes when the document scrolls. |
closeOnClick | boolean | undefined | true | Closes when the trigger is clicked. |
interactive | boolean | undefined | false | Allows pointer interaction with the tooltip content. |
positioning | TooltipPositioningOptions | undefined | bottom placement | Configures floating placement and collision handling. |
aria-label | string | undefined | — | Accessible label used by the tooltip content. |
triggerValue | string | null | undefined | — | Active trigger value when controlled. Supports two-way binding. |
defaultTriggerValue | string | null | undefined | — | Initial active trigger value when uncontrolled. |
Use [(open)]="open" or [(triggerValue)]="triggerValue" for two-way binding.
Outputs
| Output | Type | Description |
|---|---|---|
openChange | boolean | undefined | Emits the current open state. |
triggerValueChange | string | null | undefined | Emits the current active trigger value. |
openChangeDetails | TooltipOpenChangeDetails | Emits details whenever the open state changes. |
triggerValueChangeDetails | TooltipTriggerValueChangeDetails | Emits details whenever the active trigger changes. |
[appTooltipTrigger]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
value | string | undefined | — | Identifies this trigger when multiple triggers exist. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
TooltipRootProvider | Directive that provides an externally created tooltip API through value. |
TooltipContext | Structural 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. |
TooltipImports | Readonly collection containing the tooltip UI and context helpers. |
Types
| Export | Description |
|---|---|
TooltipApi | Connected tooltip state and actions. |
TooltipElementIds | Overrides for generated tooltip part IDs. |
TooltipPlacement | Supported floating-content placements. |
TooltipPositioningOptions | Floating placement and collision options. |
TooltipTriggerProps | Props used to identify a tooltip trigger. |
TooltipOpenChangeDetails | Details emitted by openChangeDetails. |
TooltipTriggerValueChangeDetails | Details emitted by triggerValueChangeDetails. |
TooltipRenderStrategyContext | Lazy-mount and unmount settings for tooltip content. |
UseTooltipOptions | Options accepted by useTooltip. |
UseTooltipProps | Root props accepted by the tooltip machine. |
UseTooltipReturn | Signal-backed tooltip machine returned by useTooltip. |
Angular
React
Solid
Svelte
Vue