Skip to content

Overlay

Creates a full-screen semi-transparent overlay, commonly used as a background for modals, drawers, and other components.

Platform Compatibility

App(vue)App(nvue)H5Mini Program

Code Examples

Basic Usage

Use v-model:show to control the visibility of the overlay.

html
<see-button title="Show Overlay" @click="show = true" />
<see-overlay v-model:show="show" />

Custom Background Color

html
<see-overlay v-model:show="show" background="rgba(255, 0, 0, 0.3)" />

Non-clickable Close

Set clickable to false to prevent the overlay from closing when clicked.

html
<see-overlay v-model:show="show" :clickable="false" />

Overlay with Content

html
<see-overlay v-model:show="show">
  <view style="display: flex; align-items: center; justify-content: center; height: 100%;">
    <text style="color: #fff;">Custom Content</text>
  </view>
</see-overlay>

API

Props

PropertyDescriptionTypeDefaultOptions
showWhether to show (v-model)booleanfalsetrue / false
z-indexz-index levelnumber1000-
backgroundBackground colorstringrgba(0, 0, 0, 0.6)CSS color value
opacityOpacitynumber10-1
clickableWhether clicking closes the overlaybooleantruetrue / false
is-animatedWhether to enable animationbooleantruetrue / false
durationAnimation duration (ms)number300-

Events

EventDescriptionCallback Parameters
onClickTriggered when the overlay is clicked-
onCloseTriggered when the overlay is closed-
onOpenTriggered when the overlay is opened-

Slots

NameDescription
defaultOverlay content

Liao ICP No. 2025070134