Description
v-viewer is an image viewer component for Vue 2 and Vue 3, built on the viewer.js library. It shows images in a viewer with rotation, scaling, zoom and the other controls viewer.js provides. You can use it in three ways: a directive that turns every img inside an element into a viewer, a component that takes an images array or a trigger prop, or a global API call that opens a gallery without rendering the images yourself. It installs from npm and works with both the Options API and the Composition API. The package can also be loaded as a UMD build in the browser, or through CommonJS or AMD. Directive modifiers let you create the viewer once with static, or rebuild it when the source images change. The component emits an inited event that gives you the viewer instance, and the plugin accepts viewer.js options, a custom toolbar, thumbnail and source image handling, and image filtering. The project has a live demo and a Chinese version of its documentation.…
Highlights
- Image viewer for Vue 2 and Vue 3
- Directive, component and API usage
- Rotation, scaling and zoom from viewer.js
- UMD, CommonJS and AMD builds
- Works with the Options and Composition APIs
Ratings & Reviews
No ratings yet
Be the first to rate v-viewer.
People also visit
v-viewer FAQ
What is v-viewer?
A Vue component, directive and API for showing images in a gallery viewer, built on viewer.js.
Which Vue versions does it support?
Vue 2 and Vue 3. The README has a separate section for Vue 2, and the install step registers the plugin with app.use().
How do I install it?
Install it from npm, import the package and its CSS file, then call app.use() to register the component, directive and API globally.
How do I use it on a page?
Add the v-viewer directive to an element, and every img inside it opens in the viewer. You can pass options as the directive value, for example inline set to true.
What is the difference between static and rebuild?
The static modifier creates the viewer once. The rebuild modifier recreates it when the source images change, which the README suggests when display problems appear with the default update.
Can I open a gallery without img elements?
Yes. In modal mode, the API function shows a gallery from an images list without rendering img elements yourself.
Can I load it without a bundler?
Yes. A UMD build works in the browser, and CommonJS and AMD builds are also covered in the README.
Is there a demo?
Yes. The README links a live demo and a Chinese version of the documentation.
What are the best v-viewer alternatives?
Popular alternatives to v-viewer include hevue-img-preview, vue-image-zoomer and vue-picture-cropper. See all v-viewer alternatives





















