Skip to content

Popup ​

Demo ​

Popup Cross-platform Example and Preview

H5 LiveInteractive browser runtime
PopupShipping Method

Basic Usage ​

vue
<script setup lang="ts">
import { ref } from 'vue'

const visible = ref(false)
</script>

<template>
  <VButton @click="visible = true">
    Open popup
  </VButton>
  <VPopup v-model:visible="visible" position="bottom" round closeable>
    <div class="popup-body">
      Popup content
    </div>
  </VPopup>
</template>

Positions ​

vue
<template>
  <VPopup v-model:visible="visible" position="top" />
  <VPopup v-model:visible="visible" position="bottom" />
  <VPopup v-model:visible="visible" position="left" />
  <VPopup v-model:visible="visible" position="right" />
  <VPopup v-model:visible="visible" position="center" />
</template>

Close Button ​

closeIcon accepts a supported built-in VIcon name such as close, back, check, or chevron-left; it defaults to close. Use the #closeIcon slot for a custom icon component or custom graphic content.

vue
<template>
  <VPopup v-model:visible="visible" closeable close-icon="back" />

  <VPopup v-model:visible="customVisible" closeable>
    <template #closeIcon>
      <VIcon name="check" />
    </template>
  </VPopup>
</template>

Props ​

PropTypeDefaultDescription
visibleboolean | undefinedundefinedControlled visibility
defaultVisiblebooleanfalseInitial uncontrolled visibility
disabledboolean | undefinedundefinedDisable internal visibility changes
position'center' | 'top' | 'bottom' | 'left' | 'right''bottom'Popup placement
overlaybooleantrueRender overlay
closeablebooleanfalseRender close button
closeIconstring'close'Supported built-in VIcon name
closeIconPosition'top-left' | 'top-right' | 'bottom-left' | 'bottom-right''top-right'Close button position marker
roundbooleanfalseRounded content marker
safeAreaInsetBottombooleanfalseBottom safe-area marker
lockScrollbooleanfalseLock body scroll while visible
closeOnClickOverlaybooleantrueClose on overlay click
zIndexnumber | stringundefinedPopup z-index
durationnumber | stringundefinedAnimation duration; numbers are seconds
destroyOnClosebooleantrueDestroy content when closed

Events ​

EventPayloadDescription
update:visiblebooleanControlled sync event
visibleChangebooleanVisibility changed
closevoidClose requested
clickOverlayvoidOverlay clicked

Slots ​

SlotDescription
defaultPopup content
closeIconCustom close icon content that replaces the default VIcon

Primitives

PopupRoot uses usePopupRoot for visibility, overlay click, and Escape close behavior; UI packages keep the Varo-style component entry.