Skip to content

MazPopover ​

MazPopover is a versatile Vue component for displaying content in overlays that bypass overflow constraints of parent elements

Basic usage ​

Adaptive trigger ​

The adaptive trigger mode automatically adapts to the user's device:

  • Desktop: Uses hover behavior (mouseenter/mouseleave)
  • Mobile/Touch devices: Uses click behavior

This provides the best user experience across all devices without requiring manual configuration.

Positions ​

TIP

The position prop is used to position the popover relative to the trigger. The chosen position will force the popover to be displayed in the chosen position.

Advanced positions ​

Prefer position and fallback position ​

TIP

The prefer-position and fallback-position props are used to position the popover relative to the trigger. The prefer-position is the position that will be used if it's available, and the fallback-position is the position that will be used if the prefer-position is not available.

When you not specify a fallback position, the popover will fallback on the best position available.

Colors ​

Tooltip role ​

A directive is available to more easily add a tooltip to an element, see vTooltip for more information.

Hover this text

Controlled popover ​

Popover is closed

Keep open on hover ​

With this option, the popover will stay open when you hover over it (a timeout is used to close the popover after a certain time).

Form example ​

Configuration options ​

Persistent (no auto-close)

Custom offset

Custom styling

Disabled state

Events ​

Event Log:

No events yet. Try opening the popover above.

Position values ​

  • auto - Automatically choose best position
  • top, bottom, left, right - Basic positions
  • top-start, top-end - Top with start/end alignment
  • bottom-start, bottom-end - Bottom with start/end alignment
  • left-start, left-end - Left with start/end alignment
  • right-start, right-end - Right with start/end alignment

Accessibility ​

MazPopover follows WAI-ARIA guidelines:

  • Focus management: Automatically manages focus when opening/closing
  • Keyboard navigation: Supports Escape key and Tab navigation
  • ARIA attributes: Proper role, aria-modal, aria-labelledby, etc.
  • Screen reader support: Appropriate roles for different use cases
  • Trigger ARIA on the real control: aria-expanded, aria-haspopup and aria-controls are set on the interactive element of the trigger slot (your button, link...), never on a wrapper around it. ARIA attributes you set yourself on that element are kept, and a combobox keeps managing its own state. When the slot has no interactive element, the wrapper becomes a focusable button (Enter / Space toggle the popover).

Best practices ​

  • Use role="tooltip" for simple informational overlays
  • Use role="dialog" for interactive content
  • Provide meaningful aria-labelledby or aria-describedby attributes
  • Ensure trigger elements are focusable and have proper labels

Props ​

NameDescriptionTypeRequiredDefaultPossible values
model-valuev-model Controls the popover open statebooleanNofalse-
positionPosition of the popover relative to trigger - Position of the popover relative to triggerMazPopoverPositionNo"auto"'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'
prefer-positionPreferred position of the popover relative to trigger when auto position is used - Preferred position of the popover relative to triggerMazPopoverPreferPositionNo'bottom-start''auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'
fallback-positionFallback position of the popover relative to trigger when prefer position is not visible - Fallback position of the popover relative to triggerMazPopoverFallbackPositionNoauto'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'
triggerHow the popover is triggered - How the popover is triggered. 'adaptive' uses hover on desktop and click on mobileMazPopoverTriggerNo"click"'click' | 'hover' | 'manual' | 'adaptive'
roleARIA role for accessibility - ARIA role for accessibilityMazPopoverRoleNo"dialog"'dialog' | 'tooltip'
aria-labelARIA label for the popoverstringNo--
announce-changesAnnounce content changes to screen readersbooleanNofalse-
disabledDisables the popover - Disables the popoverbooleanNofalse-
offsetDistance between trigger and popover in pixelsnumberNo8-
delayDelay before showing/hiding in millisecondsnumberNo0-
hover-delayDelay before closing on hover in millisecondsnumberNo150-
transitionCSS transition name for animations - 'scale-pop' | 'scale-fade' for default transitions. 'scale-pop' is a pop effect, 'scale-fade' is a fade effect.stringNo"scale-pop"'scale-pop' | 'scale-fade' | 'string'
teleport-toTeleport target selectorstringNo"body"-
overlay-classAdditional CSS classes for the overlay wrapperClassValueNo--
panel-classAdditional CSS classes for the popover panelClassValueNo--
panel-styleInline styles for the popover panelStyleValueNo--
close-on-click-outsideClose popover when clicking outsidebooleanNotrue-
close-on-escapeClose popover when pressing Escape keybooleanNotrue-
persistentPrevent auto-close (ignores click outside and escape key)booleanNofalse-
idCustom ID for the popover elementstringNo--
aria-labelledbyARIA labelledby attribute for accessibilitystringNo--
aria-describedbyARIA describedby attribute for accessibilitystringNo--
colorColor variant of the popover"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent" | "surface"No"surface"'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'destructive' | 'contrast' | 'transparent' | 'surface'
trap-focusTrap focus inside the popoverbooleanNotrue-
keep-open-on-hoverKeep popover open when hovering over the panelbooleanNofalse-
blockThe popover will be full width of the triggerbooleanNofalse-
position-referenceCSS selector or element reference to use for positioning calculations - When provided, the popover will position relative to this element instead of the trigger Useful for components with labels where you want to position relative to the actual inputstring | HTMLElementNo--

Events ​

Event namePayloadDescription
update:model-valuevalue: booleanEmitted when popover state changes
open-Emitted when popover opens
close-Emitted when popover closes
togglevalue: booleanEmitted when popover toggles
update:modelValuevalue: boolean
after-close-animation-Emitted after the close animation

Slots ​

NameDescriptionBindings
triggerTrigger element contentopen () => void - Function to open the popover
close () => void - Function to close the popover
toggle () => void - Function to toggle the popover
isOpen boolean - Current open state of the popover
trigger "click" | "hover" | "manual" - The trigger type
defaultPopover contentopen () => void - Function to open the popover
close () => void - Function to close the popover
toggle () => void - Function to toggle the popover
isOpen true - Current open state of the popover

Expose ​

open ​

Open the popover

close ​

Close the popover

toggle ​

Toggle the popover

isOpen ​

Check if the popover is open

updatePosition ​

Update the popover position

panelRef ​

Panel reference

onTransitionAfterLeave ​