Overlay
Overlay & Surface
stable
Low-level overlay with portal, scrim and position management.
API
Props
All props accepted by this component, with their type, default value and description.
- absolutebooleanfalse
- Positions the overlay absolutely within its parent instead of fixed to the viewport.
- closeOnBackbooleantrue
- Close the overlay when the browser back button is pressed.
- contentClassstring | Array<string>
- Additional CSS classes applied to the content wrapper element.
- contentPropsany
- Additional attributes passed directly to the content wrapper element.
- disabledbooleanfalse
- Prevents the overlay from opening.
- noClickAnimationbooleanfalse
- Disables the bounce animation when clicking outside a persistent overlay.
- modelValuebooleanfalse
- Controls the visibility of the overlay (v-model).
- zIndexnumber | string2000
- z-index of the overlay. Overrides the automatic stacking.
- disableGlobalStackbooleanfalse
- Opt out of the global overlay stack management.
- persistentbooleanfalse
- Prevents closing the overlay by clicking outside or pressing Escape.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- heightnumber | string
- Height of the overlay content area.
- maxHeightnumber | string
- Maximum height of the overlay content area.
- maxWidthnumber | string
- Maximum width of the overlay content area.
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Width of the overlay content area.
- target'parent' | 'cursor' | TAnyString | Element | ComponentPublicInstance | [x: number, y: number] | undefined
- activator'parent' | 'cursor' | TAnyString | Element | ComponentPublicInstance
- activatorPropsany
- openOnClickboolean
- openOnContextMenuboolean
- openOnHoverboolean
- openOnFocusboolean
- closeOnContentClickboolean
- closeDelaynumber | string
- openDelaynumber | string
- locationStrategyTLocationStrategy | TLocationStrategyFn
- locationTAnchor
- originTAnchor | 'auto' | 'overlap'
- offsetnumber | string | Array<number>
- viewportMarginnumber
- scrollStrategyTScrollStrategy | TScrollStrategyFn
- containedboolean
- eagerboolean
- transitionboolean | string | TTransitionProps'dialog-transition'
- Vue transition applied when the overlay enters and leaves.
- scrimboolean | stringtrue
- Whether to show the backdrop scrim. Pass a color string to tint it.
- attachboolean | string | Element | nullfalse
- Teleport target. true = parent element, string = CSS selector, Element = direct reference.
API
Slots
Content slots exposed by this component.
- #activator
- Trigger element. Receives isActive and spread-ready props for the activator element.
- #default
- Content rendered inside the overlay. Receives isActive (the open state ref).
API
Emits
Events emitted by this component.
- @afterEntervoid
- Fired after the enter transition completes.
- @afterLeavevoid
- Fired after the leave transition completes.
- @keydownKeyboardEvent
- Fired on keydown events (used for Escape key handling).
- @update:modelValueany
- Fired when the overlay opens or closes.
- @click:outsideMouseEvent
- Fired when the user clicks outside the overlay content.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic overlay
With activator slot
Persistent overlay
Ecosystem
Family
Components from the same folder that share conventions and often compose together.