Svelte Img screenshot

Svelte Img

Author Avatar Theme by Zerodevx
Updated: 27 Sep 2024
348 Stars

High-performance responsive/progressive images for SvelteKit

Categories

Overview

svelte-img is a high-performance responsive/progressive image plugin for SvelteKit. It automatically transforms local images into multiple widths and next-gen formats, while rendering a minimally invasive HTML representation into your SvelteKit project. The plugin also includes special effects such as fade-in on image reveal and parallax vertical scroll effect.

Features

  • Image Transformation: automatically transforms local images into multiple widths and next-gen formats.
  • Fade-in Effect: includes a fade-in effect on image reveal.
  • Parallax Scroll: supports a parallax vertical scroll effect.

Installation

To use svelte-img, follow these steps:

  1. Install the package.
  2. Add the imagetools plugin to your vite.config.js file.
  3. Optionally, create a new file at src/ambient.d.ts to silence TypeScript warnings on image imports.

Summary

svelte-img is a powerful plugin for SvelteKit that provides high-performance responsive/progressive images. With features such as image transformation, fade-in effect, and parallax scroll, it offers an easy and effective way to handle images in your SvelteKit projects. The installation process is simple and straightforward, making it accessible to developers of all levels of experience.