Skip to content

Tooltip for Angular

AngularOverlays

Short text hint for a trigger that meets WCAG 1.4.13: shown after a delay on pointer hover and immediately on keyboard focus, hoverable, dismissible with Escape without moving focus, and referenced from the trigger by aria-describedby (or aria-labelledby for icon-only controls).

  • Hover and focusShows on pointer hover and keyboard focus, and hides on Escape.
  • Label or descriptionDescribes its trigger, or names an icon-only control as its label.
  • Tunable delaysShow and hide delays keep tooltips from flickering while the pointer moves.
  • Smart placementPrefers a side you choose and flips to stay inside the viewport.

Behavior, design tokens, and limitations are described on the Tooltip page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiTooltip } from '@absoluteui/angular/tooltip';
import { AuiButton } from '@absoluteui/angular/button';
@Component({
selector: 'app-editor-toolbar',
imports: [AuiTooltip, AuiButton],
template: `
<button type="button" auiButton auiTooltip="Ctrl+S" tooltipPlacement="bottom">Save</button>
<button type="button" auiButton icon="menu" variant="ghost" auiTooltip="Settings" tooltipRelation="label"></button>
`,
})
export class EditorToolbarComponent {}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiTooltip } from '@absoluteui/angular/tooltip';

Defaults for every instance: provideAbsoluteUIConfig({ components: { tooltip: { ... } } }) (see Configuration).

Class AuiTooltip; template reference #ref="auiTooltip".

AbsoluteUI Tooltip on its trigger: <button auiTooltip="Opens the help center">.

Server rendering: Renders in the browser only; on the server the element stays empty.

Input Type Default Description
auiTooltip string Required. Tooltip text (text only).
tooltipRelation TooltipRelation 'description' Trigger gets aria-describedby (‘description’) or aria-labelledby (‘label’, for icon-only controls).
tooltipPlacement Placement 'top' Preferred side and logical alignment; flips and shifts to fit.
tooltipShowDelay number '500' Hover delay before showing, ms. Keyboard focus shows immediately.
tooltipHideDelay number '100' Delay after the pointer leaves the trigger and tooltip before hiding, ms.
tooltipDirection "ltr" | "rtl" 'ltr' Resolves logical start/end placements.
Output Payload Description
(opened) null After the tooltip became visible (dispatched on the tooltip element). Re-emits aui-open.
(closed) null After the tooltip was hidden. Re-emits aui-close.

Call them through a viewChild query or a template reference.

Method Description
show(): void Show the tooltip now (without the hover delay).
hide(): void Hide the tooltip.

Pattern: WAI-ARIA APG Tooltip pattern, with WCAG 1.4.13 Content on Hover or Focus.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Tooltip: Accessibility and performance.