NuxtN
Nuxtβ€’15mo ago
.fondazione

NuxtImage Responsive Image Sizes

Hi everyone πŸ‘‹

How do you use NuxtImage with srcset & sizes? Do you really set the sizes for each image you place in your project?

In the past I've used my own image component with lazysizes which has a auto sizes function where it detects the rendered image size and sets the correct data-sizes attribute, I think the same exists in Next image if I am correct.
I am a bit surprised this does not exist with NuxtImage yet, or does it? I also checked out unlazy which has something like this too: https://unlazy.byjohann.dev/guide/usage#auto-calculation-of-the-sizes-attribute

Am I overseeing something?
Universal lazy loading library for placeholder images leveraging native browser APIs
Was this page helpful?