UiPopup

A panel anchored to coordinates.

Contents

A floating panel positioned at explicit x/y coordinates, with an invisible backdrop that dismisses it on outside click. Useful for context menus at a pointer position.

Examples

Anchored menu

x/y are measured from the nearest positioned ancestor, so a relative wrapper anchors the panel to a trigger. Here y = 40 drops it just below the button; click outside to dismiss.

<div class="relative inline-block">
  <UiButton variant="outline" @click="state.open = !state.open">
    Actions <UiIcon name="mdi:menu-down" class="w-4 h-4" />
  </UiButton>
  <UiPopup :show="state.open" :x="0" :y="40" @close="state.open = false">
    <UiDropdownItem icon="mdi:content-copy" label="Copy" />
    <UiDropdownItem icon="mdi:share-variant" label="Share" />
    <UiDropdownItem icon="mdi:trash-can-outline" label="Delete" color="red" />
  </UiPopup>
</div>

Props

NameTypeDefaultDescription
showbooleanfalseWhether the popup is visible.
xnumber0Left coordinate in pixels.
ynumber0Top coordinate in pixels.
offsetYnumber0Extra vertical offset.
widthstring'w-56'Panel width class.
panelZstring'z-50'Panel stacking class.
backdropZstring'z-40'Backdrop stacking class.

Events

EventPayloadDescription
closevoidEmitted when the backdrop is clicked.

Slots

SlotDescription
defaultPopup content.