Skip to content

Demo

Clone the repo and run the demo locally:

bash
git clone https://github.com/macrulezru/vue-image-kit.git
cd vue-image-kit
npm run demo

The dev server starts at http://localhost:5173. No extra setup required — the demo imports directly from src/ via Vite alias.

TabWhat it shows
Basic<VImage> props playground — live controls for all options, all loading states
Blurhash & LQIPSide-by-side blurhash canvas vs base64 blur-up; live blurhash string input
Color & ShimmerplaceholderMode comparison — blur vs ThumbHash vs solid average color vs animated shimmer
AVIF / WebPFormat switching via <picture>, browser format detection, file size comparison
srcsetThree previews at 400 / 800 / 1200 px — currentSrc changes with sizes; live sizes editor
Density 1x/2x/3xDensity descriptors for fixed-size images; live generateDensitySrcset output and device DPR
Responsive sourcesArt direction with named breakpoints — <source media="..."> switching
Focal point:focal="{ x, y }"object-position with a draggable marker over a cropped frame
Layout & prioritylayout="fixed" | "responsive" | "fill" side by side; priority (eager + fetchpriority="high")
Lazy Load20+ images with per-item status badges; configurable rootMargin and threshold
v-lazy-img36-card grid with background-image lazy loading; LQIP toggle; event log
Background imageuseBackgroundImage() — lazy + responsive image-set() background with blur-up
Encode (upload)Client-side encodeThumbHash / encodeBlurhash from an uploaded file, with decoded preview
Error StateDefault SVG fallback vs custom #error slot; @error event log; maxRetries exponential backoff demo
HeadlessuseImage() composable with fully custom markup and reactive state display
CDN adaptersLive URL / srcset builder for all 12 providers (Cloudinary, imgix, Bunny, Sanity, Storyblok, Contentful, Vercel, Cloudflare, ImageKit, TwicPics, Netlify, Gumlet)
Build-time importsThe ?vik / ?thumbhash workflow explained, with the resolved metadata shape

Nuxt demo

The Vite demo above covers the component/CLI/CDN/server features but nothing Nuxt-specific. demo-nuxt/ is a separate, minimal Nuxt 3 app (same "import straight from src/" trick, via nuxt.config.ts's vite.resolve.alias) that exercises exactly the parts the Vite demo can't: module registration + breakpoints, auto-imported composables/utilities with zero explicit imports, onDemandServer actually registering a working Nitro route, and server-rendered <VImage> output (isSSR branch) — verified against both nuxt dev and a real nuxt build output.

bash
npm run demo:nuxt        # installs demo-nuxt's own deps + starts nuxt dev
npm run demo:nuxt:build  # production build (.output/), no dev server