Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 06 Overlays

Tooltip

A short label for a control, shown on hover and on keyboard focus and read by screen readers as its description. The pointer can move onto it and Escape hides it. Touch screens never show tooltips, so never put anything needed in one.

Use it in Angular
import { TooltipDirective } from '@okaapi-ui/angular';
// On the Angular CDK overlay. Add @angular/cdk/overlay-prebuilt.css.

On icon buttons

The button still needs its own name; the tooltip shows that name to sighted users.

Angular
<button ui-button variant="ghost" aria-label="Copy link" uiTooltip="Copy link">
  <ui-icon name="copy" />
</button>
<button ui-button variant="secondary" uiTooltip="Sends the invoice to the customer's email">
  Send invoice
</button>

In Arabic

Angular
<button ui-button variant="secondary" uiTooltip="بيبعت الفاتورة لإيميل العميل">ابعت الفاتورة</button>

When to use something else

If you needUse
Content with links or buttonsPopover
Help the reader needs to fill a fieldThe field’s hint
Show a keyboard shortcutKeyboard key inside the tooltip

Inputs

NameTypeDefaultWhat it does
uiTooltipstring — Required. The short label, on any focusable element.

Keyboard and screen readers

KeysWhat they do
Tab Focus the control, and its tooltip shows.
Escape Hide the tooltip.
  • Read as the control’s description; the pointer can move onto it.
  • Touch screens never show tooltips, so nothing needed may live only in one.