Skip to content

ImagePreview

Full-screen overlay preview triggered by a thumbnail click.

Basic Usage

vue
<script setup>
import { ref } from 'vue'
const visible = ref(false)
const url = 'https://example.com/big.jpg'
</script>

<template>
  <img :src="url" @click="visible = true" />
  <MImagePreview v-model:visible="visible" :image-url="url" />
</template>

Props

NameTypeDefaultDescription
visibleboolean-Visibility (supports v-model:visible)
imageUrlstring-Full-size image URL

Events

NameArgsDescription
update:visible(value: boolean)Emitted on close
close-Emitted on close

Released under the MIT License.