# Popover

The Popover component is a generic popover component for displaying things like filters and menus in an element over the page.

# Using a Popover

To open a Popover, add something like a button to the action slot and the popover content to the default slot. You can then use popover.toggle() to open the popover.

# Slot scope

Popover uses scoped slots under the hood to pass attributes to the slot. You can use these attributes to do all kinds of things with your popover.

Attribute Type Description
open function Opens the popover
toggle function Opens & closes the popover
update function Updates the popover position
close function Closes the popover
shown Boolean Whether the popover is shown or not

# Closing a Popover

Popovers will close automatically when someone clicks outside of them, but you can use the close() or toggle() functions to close it manually.

In this demo, we open a popover with open() and then close() it after 5 seconds.

In this demo, we use a click event inside the popover to close it.

# Variant

Use the variant prop to change the style of the popover.

# Padding

Use the padding prop to adjust the padding on the Popover.

# Placement

The placement prop one of the placement options for popper.js. Click here for the full list of options.

# Strategy

Use the strategy prop to set the positioning method for the popover. By default this is absolute but it can be changed to fixed which can be useful for cases when you want the tooltip to not be constrained by a parent's overflow rules. Please see the Popper.js docs (opens new window) for more information.

# Customized Popovers

The options prop allows you to fully customize the options of popper.js. Please see the Popper.js docs (opens new window) for a full list of options.

# Offsets

Use the offset prop to apply the offset on the Popover once opened. Please see the Popper.js docs (opens new window)

# Transitions

Use the transition-speed prop to apply the transition speed on the Popover.

# Events

Popover have two events @close and @open, fired when the Popover is opened or closed.

Last Updated: 3/28/2023, 1:55:36 PM