Vivid API

Popover

Displays floating rich content anchored to a specific trigger element, rendering on top of all other page elements.

Usage

import { VPopover, VButton, VIcon } from '@vonage/vivid-api-vue';
import { registerPopover } from '@vonage/vivid-api';
import { registerButton } from '@vonage/vivid-api';
registerPopover('your-prefix');
registerButton('your-prefix');

Anchor

It is recommended use the anchor slot to set the anchor.

The anchor attribute can be used to pass the anchor element.

Open

The open attribute controls the open state of the Popover.

Manual

The manual attribute sets the Popover to manual mode, disabling light-dismiss (clicking outside) and displaying a close button.

Slots

Anchor Slot

Place the anchor element inside the anchor slot of the Popover.

Default Slot

Use default slot to add rich content to the Popover.

Use footer slot to add extra content to the bottom of the Popover.

CSS Variables

Padding

Use the --popover-padding variable to set the padding around the Popover’s content.

  • Default: 24px

Gap

Use the --popover-gap variable to set the size of the gap between Popover’s content and footer.

  • Default: 24px

Backdrop

Use the --popover-backdrop-bg variable to set the background color of the Popover’s backdrop.

  • Default: transparent

API Reference

Properties

PropertyTypeDefaultDescription
alternatebooleanSets the color-scheme to alternate (dark/light)
anchorHTMLElementSets the Popover's anchor element. Prefer using the [`anchor` slot](/components/popover/code/#anchor-slot) if possible.
arrowbooleanAdds a small triangle to indicate the trigger element.
dismissButtonAriaLabelstringOverrides the default "Close" aria-label of Dismiss button when manual mode is enabled.
layout'condensed' | 'default'Can be used to enable a condensed layout with smaller paddings and gaps.
manualbooleanSets the Popover to manual mode, disabling light-dismiss (clicking outside) and displaying a close button.
offsetnumberSets the offset between popover and the anchor element.
openbooleanSets the open state of the Popover
placement'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start'Controls the position of the Popover, relative to its anchor element.
PropertyTypeDefaultDescription
alternatebooleanSets the color-scheme to alternate (dark/light)
anchor
(property only)
HTMLElementSets the Popover's anchor element. Prefer using the [`anchor` slot](/components/popover/code/#anchor-slot) if possible.
arrowbooleanAdds a small triangle to indicate the trigger element.
dismiss-button-aria-labelstringOverrides the default "Close" aria-label of Dismiss button when manual mode is enabled.
layout'condensed' | 'default'Can be used to enable a condensed layout with smaller paddings and gaps.
manualbooleanSets the Popover to manual mode, disabling light-dismiss (clicking outside) and displaying a close button.
offsetnumberSets the offset between popover and the anchor element.
openbooleanSets the open state of the Popover
placement'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start'Controls the position of the Popover, relative to its anchor element.

Slots

NameDescription
anchorSlot for the trigger element.
defaultDefault slot for the popover content.
footerUse the footer slot in order to add action buttons or other contents to the bottom of the dialog.
NameDescription
anchorSlot for the trigger element.
defaultDefault slot for the popover content.
footerUse the footer slot in order to add action buttons or other contents to the bottom of the dialog.

Events

NameTypeDescription
closeCustomEventFired when the popover closes.
openCustomEventFired when the popover opens.
NameTypeDescription
closeCustomEventFired when the popover closes.
openCustomEventFired when the popover opens.

Methods

NameParamsReturnsDescription
hidevoid
showPromise<void>
togglevoid
updatePositionPromise<void>Updates the position of the popover