VOverlay
TheVOverlay component is used to emphasize a particular element or parts of it. It provides a scrim layer and can be used as a foundation for components like dialogs, menus, and navigation drawers.
Usage
The overlay is controlled by themodelValue prop.
Activator
Theactivator slot allows you to bind the overlay trigger to a specific element.
The activator slot provides
props that should be bound to the trigger element to handle opening and closing.Absolute and Contained
Theabsolute prop positions the overlay absolutely within its parent, and contained keeps it within the parent boundaries.
Scrim
Thescrim prop controls the backdrop overlay. It can be disabled or set to a custom color.
Opacity
Customize the overlay opacity with theopacity prop.
Persistent
Whenpersistent is enabled, clicking outside won’t close the overlay.
Persistent overlays will show a bounce animation when clicked outside, providing visual feedback to users.
Location Strategies
The overlay supports various location strategies for positioning content relative to the activator.Scroll Strategies
Control how the overlay behaves when the page scrolls.Props
Controls whether the overlay is visible.
Positions the overlay absolutely within its parent.
Specifies which DOM element the overlay should detach to.
Closes the overlay when the browser back button is pressed.
Keeps the overlay contained within its parent element.
Applies a custom class to the overlay content.
Apply additional props to the overlay content element.
Disables the overlay from opening.
Sets the overlay opacity.
Disables the bounce animation when clicking outside a persistent overlay.
Clicking outside or pressing ESC will not dismiss the overlay.
Controls the scrim (backdrop). Can be a boolean or color string.
The z-index used for the overlay.
Explicitly sets the activator element.
Props to pass to the activator element.
Opens the overlay when the activator is clicked.
Opens the overlay when hovering over the activator.
Opens the overlay when the activator is focused.
Delay in milliseconds before the overlay opens.
Delay in milliseconds before the overlay closes.
Strategy used when the overlay is open and scrolling.
Strategy for positioning the overlay. Options include
static, connected.Specifies the anchor point of the overlay.
Sets the transition origin.
Offset the overlay from its position.
Sets the component transition.
Slots
The default Vue slot for overlay content.
Slot for the activator element that triggers the overlay.
Events
Emitted when the overlay visibility changes.
Emitted when clicking outside the overlay content.
Emitted when a key is pressed while the overlay is active.
Emitted after the overlay transition has entered.
Emitted after the overlay transition has left.