0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Lazy loading, fetch priority and image decoding hints: three attributes that decide when and how urgently the browser fetches images, iframes and scripts.
Overview
Three native attributes decide when and how urgently the browser fetches a resource. This page covers all three:
loading — when to fetch: now, or when the element comes near the viewport.
fetchpriority — how urgently to fetch, relative to other resources of the same kind.
decoding — whether the image may be decoded without holding up other content.
Applies to:loading on <img> and <iframe>; the spec has added <video> and <audio>, so far only in Chrome. fetchpriority on <img>, <link> and <script>. decoding on <img>.
Eager hero, lazy images below the fold
12345
<imgsrc="hero.jpg"fetchpriority="high"width="1200"height="600"alt="Volunteers planting trees on a hillside"><imgsrc="gallery-1.jpg"loading="lazy"decoding="async"width="600"height="400"alt="Seedlings in biodegradable pots">
Values
loading
Value
Meaning
eager
Fetch straight away.
lazy
Wait until the element is near the viewport. The browser decides how near.
Absent or invalid (the default)
eager.
fetchpriority
Value
Meaning
high
Fetch ahead of other resources of the same type.
low
Fetch behind other resources of the same type.
auto, absent or invalid (the default)
The browser's own priority.
decoding
Value
Meaning
async
Other content may be shown before this image has decoded.
sync
Show this image together with the content around it.
auto, absent or invalid (the default)
The browser decides.
Examples
The LCP image
Never lazy-load the Largest Contentful Paint image. Give it fetchpriority="high" so it is fetched ahead of other images found at the same time.
LCP image
12
<imgsrc="hero.jpg"fetchpriority="high"width="1600"height="700"alt="Cyclists on a coastal road at sunrise">
Lazy images with sizes="auto"
A lazy image can let the browser measure its slot instead of a hand-written sizes. See srcset.
Lazy responsive image
12345
<imgloading="lazy"decoding="async"sizes="auto, 100vw"src="trail-800.jpg"srcset="trail-400.jpg 400w, trail-800.jpg 800w, trail-1200.jpg 1200w"width="1200"height="800"alt="Gravel trail through a pine forest">
Lazy iframes
Maps, video and social embeds below the fold are the biggest wins: each one can pull in megabytes of script. Every iframe needs a title.
Lazy embed
12
<iframesrc="https://www.openstreetmap.org/export/embed.html?bbox=-0.13,51.50,-0.12,51.51"loading="lazy"title="Map of the venue"width="600"height="400"></iframe>
Priorities for links and scripts
fetchpriority on link and script
12345
<!-- A font the first render needs --><linkrel="preload"href="/fonts/body.woff2"as="font"type="font/woff2"crossoriginfetchpriority="high"><!-- Independent, non-critical script: async and low priority --><scriptsrc="https://analytics.example.com/tag.js"asyncfetchpriority="low"></script>
In Vanilla Breeze
data-responsive runs after the parser has requested the image, so loading and fetchpriority must be in your markup to have any effect. It adds decoding="async" when you have not set decoding, and it leaves sizes="auto" on lazy images to the browser (src/utils/responsive-init.js).
<youtube-player> renders a lazy, async-decoded thumbnail and only inserts the YouTube iframe (with loading="lazy") when the user presses play.
data-mock marks the remote placeholder images it generates (photo, placehold and portrait presets) as lazy. VB's own demos use local SVG placeholders from src/assets/placeholders/.
Image defaults.src/native-elements/image/styles.css makes images fluid (max-inline-size: 100%; block-size: auto), so width and height attributes reserve the right aspect ratio without fixing the size. That is what lazy images need.
Accessibility
Lazy loading does not change alt: assistive technology reads it whether or not the image has loaded.
Lazy iframes still need a title describing their content.
Reserve space with width and height. Content that jumps as images arrive is hard to read and to click, especially with magnification.
Browser support
loading on images: Chrome 77, Firefox 75, Safari 15.4. On iframes: Chrome 77, Firefox 121, Safari 16.4. On <video> and <audio>: Chrome 150 only, experimental. fetchpriority: Chrome 101, Firefox 132, Safari 17.2. decoding: all current browsers (November 2026). Unsupported values and attributes are ignored, so the resource loads normally.
Gotchas
Lazy loading is off when scripting is off. The spec disables it so that lazy images cannot be used to track scroll position without JavaScript. Such images load eagerly.
Lazy images need a size. An image with no width/height and no CSS size is 0×0 before it loads, so many of them can sit "in view" at once and all load together.
Do not lazy-load above the fold. It delays the images people see first, often including the LCP image.
CSS backgrounds are not affected by loading.
fetchpriority is relative. Marking everything high is the same as marking nothing. Use it for one or two resources.
decoding="sync" rarely helps; leave it at the default unless you have measured a problem.