Vivid API

Tooltip

A Tooltips provides a short description of a page element or control that become visible when the target is hovered over or focussed on.

Usage

import { registerTooltip } from '@vonage/vivid-api';
registerTooltip('your-prefix');

Anchor

It’s best to use the anchor slot to set the anchor, but you can also use the anchor attribute. Either set it to the id of the anchor element or pass the anchor element itself.

Slots

Anchor Slot

Tooltips need to be anchored to an element. Place the anchor element inside the anchor slot of the tooltip.

Do not use a non-interactive element (div, p, etc.) as an anchor, as the Tooltip will not be accessible to keyboard or screen reader users.

CSS Variables

Max Inline Size

The --tooltip-max-inline-size variable sets the Tooltip’s max inline size.

  • Default: 30ch

API Reference

Properties

PropertyTypeDefaultDescription
anchorstring | HTMLElementID or direct reference to the component's anchor element.
openboolean
placement'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start'
textstringText content of the Tooltip
PropertyTypeDefaultDescription
anchorstring | HTMLElementID or direct reference to the component's anchor element.
openboolean
placement'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start'
textstringText content of the Tooltip

Slots

NameDescription
anchorUsed to set the anchor element for the tooltip.
NameDescription
anchorUsed to set the anchor element for the tooltip.