Lazyload

@sgroup/tailwind-plugins/lazyload

We encorporate Lazysizes for best-in-class lazyloading. You should use this for any image or background element below the fold for best page performance.

All that's required is adding a .lazyload class on an image, and changing the src attribute to data-src. To further improve this, we've added a fade transition on images so they fade in on-load.

Breakpoints - Mobile-first

Background images

Similar to using img elements, you can lazyload background image. You'll need to still use the .lazyload class, but add the image url to the data-bg attribute.

Breakpoints - Mobile-first

Loading container

For better visual feedback, you can use the .lazyload-container and .loading classes to provide a spinning icon when the image is loading.

Breakpoints - Mobile-first