Popover

Basic usage

Similar to Tooltip, Popover is also built with BPopper. So for some duplicated attributes, please refer to the documentation of Tooltip.

The trigger attribute is used to define how popover is triggered: hover, click, focus or contextmenu . If you want to manually controll it, you can set :visible.

Virtual Triggering

Like Tooltip, Popover can be triggered by virtual elements, if your use case includes separate the triggering element and the content element, you should definitely use the mechanism, normally we use #reference to place our triggering element, with triggering-element API you can set your triggering element anywhere you like, but notice that the triggering element should be an element that accepts mouse and keyboard event.

Rich Content

Other components/elements can be nested in popover. Following is an example of nested table.

Replace the content attribute with a default slot.

Nested Operation

Of course, you can nest other operations. It's more light-weight than using a dialog.

Attributes

AttributeDescriptionTypeAccepted ValuesDefault
triggerhow the popover is triggeredstringclick / focus / hover / contextmenuclick
titlepopover titlestring
effectTooltip theme, built-in theme: dark / lightstringstringlight
contentpopover content, can be replaced with a default slotstring
widthpopover widthstring / numberMin width 150px
placementpopover placementstringtop / top-start / top-end / bottom / bottom-start / bottom-end / left / left-start / left-end / right /right-start / right-endbottom
disabledwhether Popover is disabledbooleanfalse
visible / v-model:visiblewhether popover is visibleBooleanfalse
offsetpopover offsetnumber0
transitionpopover transition animationstringb-fade-in-linear
show-arrowwhether a tooltip arrow is displayed or not.booleantrue
popper-optionsparameters for popper.jsopen in new windowobjectplease refer to popper.jsopen in new window{modifiers: [{name: 'computeStyles',options: {gpuAcceleration: false}}]}
popper-classcustom class name for popoverstring
show-afterdelay of appearance, in millisecondnumber0
hide-afterdelay of disappear, in millisecondnumber200
auto-closetimeout in milliseconds to hide tooltipnumber0
tabindextabindexopen in new window of Popovernumber
teleportedwhether popover dropdown is teleported to the bodybooleantrue / falsetrue
persistentwhen popover inactive and persistent is false , popover will be destroyedbooleantrue

Slots

NameDescription
text content of popover
referenceHTML element that triggers popover

Events

Event NameDescriptionParameters
showtriggers when popover shows
before-entertriggers when the entering transition befores
after-entertriggers when the entering transition ends
hidetriggers when popover hides
before-leavetriggers when the leaving transition befores
after-leavetriggers when the leaving transition ends
Last Updated:
Contributors: Tam Mai