Skip to content

zk-lazy-image ​

An image loaded when it comes into view, with srcset and a way to fit it.

Props ​

PropTypeDefaultDescription
srcstringrequiredURL
altstring''Alternative text
srcsetstring|nullnullsrcset
sizesstring|nullnullsizes
eagerboolfalseLoad at once (loading="eager"), for the image at the top of the page
fitstring'cover'data-fit: cover, contain... for object-fit in your style
classstring|nullnullCSS class(es) merged onto the root element

Undeclared attributes forward to the root element.

The browser does the work (loading="lazy" and decoding="async"). Give width and height to avoid the shift of the page. The placeholder and the error state of the Vue component are not ported.

Examples ​

Basic ​

blade
<x-zk-lazy-image src="/a.jpg" alt="A cliff" srcset="/a-2x.jpg 2x" width="800" height="600" />

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.