
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
svelte-image-viewer
Advanced tools
A couple of simple components for displaying content with pan and zoom capabilities.
A couple of simple components for displaying content with pan and zoom capabilities.
https://svelte-image-viewer.vercel.app/
https://github.com/user-attachments/assets/8f41776c-b718-4fd2-8afe-942e54db5d62
https://github.com/user-attachments/assets/43e45ee0-a282-4204-a08b-088e40edcd96
npm install svelte-image-viewer
pnpm add svelte-image-viewer
bun add svelte-image-viewer
ImageViewer componentThe ImageViewer component is a simple image viewer that displays an image with pan and zoom capabilities.
<script>
import { ImageViewer } from "svelte-image-viewer";
</script>
<div
style="position: relative; height: 512px; user-select: none; border: 1px solid white;"
>
<ImageViewer src="https://picsum.photos/256" />
</div>
Viewer componentThe Viewer component displays its children inside a container with pan and zoom capabilities.
<script>
import { Viewer } from "svelte-image-viewer";
</script>
<div
style="position: relative; height: 512px; user-select: none; border: 1px solid white;"
>
<Viewer>
<img src="https://picsum.photos/256" alt="" />
</Viewer>
</div>
These components utilize Svelte's Attachments, which were introduced in Svelte 5.29.
If you're using an older version of Svelte (prior to 5.29), import from svelte-image-viewer/legacy to access the legacy versions that rely on Actions.
If you find this project useful, consider supporting it by buying me a coffee:
Your support is appreciated. Thank you!
FAQs
A couple of simple components for displaying content with pan and zoom capabilities.
The npm package svelte-image-viewer receives a total of 97 weekly downloads. As such, svelte-image-viewer popularity was classified as not popular.
We found that svelte-image-viewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.