Vivid API

Toggletip

A Toggletip is a type of Tooltip that is opened when clicking or tapping on the trigger button.

Usage

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

Open

The open attribute controls the open state of the Toggletip.

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

Default Slot

Use default slot to add content to the Toggletip.

Anchor Slot

Toggletips need to be anchored to an element. Place the anchor element inside the anchor slot of the Toggletip.

The anchor element must be clickable and in most cases, will be a button displaying an information glyph as in the example below.

Action Items Slot

You can add action items elements (Buttons) using the action-items slot. They will be displayed right-aligned at the bottom of the Toggletip.

CSS Variables

Max Inline Size

The --toggletip-max-inline-size variable sets the toggletip’s max inline size.

  • Default: 30ch

API Reference

Properties

PropertyTypeDefaultDescription
alternatebooleanInverted color scheme
anchorstring | HTMLElementID or direct reference to the component's anchor element.
headlinestringHeadline text for the Toggletip
openbooleanSets the open state of the Toggletip
placement'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start'Prefered placement of the toggletip in relation to the anchor element
PropertyTypeDefaultDescription
alternatebooleanInverted color scheme
anchorstring | HTMLElementID or direct reference to the component's anchor element.
headlinestringHeadline text for the Toggletip
openbooleanSets the open state of the Toggletip
placement'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start'Prefered placement of the toggletip in relation to the anchor element

Slots

NameDescription
action-itemsThe content to display in the toggletip action items.
anchorUsed to set the anchor element for the toggletip.
defaultThe content to display in the toggletip.
NameDescription
action-itemsThe content to display in the toggletip action items.
anchorUsed to set the anchor element for the toggletip.
defaultThe content to display in the toggletip.