@unlazy/nuxt
@unlazy/nuxt
Lazy loading library for placeholder images
@unlazy/nuxt
Nuxt module for unlazy, native image lazy loading with BlurHash and ThumbHash placeholders.
- 🎀 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 automaticsizes
Installation
# pnpm
pnpm add @unlazy/nuxt
# npm
npm i @unlazy/nuxtRequires Nuxt 4.
Quick Start
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@unlazy/nuxt'],
})The UnLazyImage component is auto-imported globally:
<template>
<UnLazyImage
blurhash="LKO2:N%2Tw=w]~RBVZRi};RPxuwH"
src-set="image-320w.jpg 320w, image-640w.jpg 640w"
auto-sizes
/>
</template>Documentation
📖 Read the full documentation, including hash-based placeholders, Core Web Vitals, and SSR.
Migrating From v2
See the migration guide for breaking changes in v3.
License
MIT License © 2023-PRESENT Johann Schopplich