Overlay
Overlay & Surface
stable
Low-level overlay with portal, scrim and position management.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic overlay
With activator slot
Persistent overlay
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.