@miletorix/vitepress-image-viewer
v1.3.2
Published
VitePress image viewer with zoom, drag, fullscreen overlay, captions and download button. Automatically enhances all images on the page. Built with Vue 3.
Downloads
3,267
Maintainers
Readme
vitepress-image-viewer
VitePress image viewer with zoom, drag, fullscreen overlay, captions and download button. Ability to change the background to transparent. Automatically enhances all images on the page. Built with Vue 3.
Live Demo and more information
✨ See it in action:
👉 https://miletorix.github.io/vitepress-image-viewer/
Installation
npm i @miletorix/vitepress-image-viewerUsage
Configuration
// docs/.vitepress/theme/index.ts
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import ImageViewerP from '@miletorix/vitepress-image-viewer' //[!code ++]
import '@miletorix/vitepress-image-viewer/style.css' //[!code ++]
export default {
extends: DefaultTheme,
enhanceApp(ctx) {
ImageViewerP(ctx.app) //[!code ++]
}
}Advanced configuration
transparentBg?: boolean - Use transparent dark overlay instead of solid background. Default is true.
autoShowThumbnails?: boolean - Automatically show thumbnails on desktop. Default is true.
// docs/.vitepress/theme/index.ts
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import ImageViewerP from '@miletorix/vitepress-image-viewer' //[!code ++]
import '@miletorix/vitepress-image-viewer/style.css' //[!code ++]
export default {
extends: DefaultTheme,
enhanceApp(ctx) {
ImageViewerP(ctx.app, { //[!code ++]
transparentBg: false, //[!code ++] default is true
autoShowThumbnails: false //[!code ++] default is true
}) //[!code ++]
}
}Preview

