@unlazy/vue

Vue lazy loading library for placeholder images
30,827 889
Install
npm install @unlazy/vue
Latest Version:2.0.1
Vue:3
License:MIT
Last Updated:Aug 7, 2026
Links: GitHub  ·  npm
Maintainer: johannschopplich

@unlazy/vue

npm version bundle

Vue component for unlazy, the universal lazy loading library leveraging native browser APIs.

  • 🎀 Native: Utilizes the loading="lazy" attribute
  • 🌊 BlurHash & ThumbHash support: SSR & client-side decoding
  • ⚡ Core Web Vitals-aware: Eager-priority path for above-the-fold images, dev-mode LCP warning
  • 🎟 <picture>: Art direction with automatic sizes

Installation

# pnpm
pnpm add @unlazy/vue

# npm
npm i @unlazy/vue

Quick Start

<script setup lang="ts">
import { UnLazyImage } from '@unlazy/vue/components'
</script>

<template>
  <UnLazyImage
    blurhash="LKO2:N%2Tw=w]~RBVZRi};RPxuwH"
    src-set="image-320w.jpg 320w, image-640w.jpg 640w"
    auto-sizes
    @image-load="img => console.log('Loaded:', img.src)"
  />
</template>

You can also register the component globally; see the Vue integration guide.

Documentation

📖 Read the full documentation, including hash-based placeholders, Core Web Vitals, and SSR.

Migrating from v1

See the migration guide for breaking changes in v2, including the @loaded → @image-load rename and the new @image-error event.

License

MIT License © 2023-PRESENT Johann Schopplich

Related Packages

@unlazy/core

Universal lazy loading library for placeholder images leveraging native browser...

232,463 889
@unlazy/nuxt

Nuxt lazy loading module for placeholder images

63,147 889
@vuecs/placeholder

Skeleton / placeholder loading components for vuecs (the Twitter/Facebook shimme...

6,554 4
magic-img

让你的图片加载更加优雅

987 75

Version History

Version Released License
2.0.1 MIT
2.0.0 MIT
1.1.0 MIT
1.0.0 MIT
0.12.4 MIT