responsive images

Offering several sizes of the same image so each device downloads the smallest one that still looks sharp.

In more detail

The srcset attribute lists image files and their widths, and sizes tells the browser how wide the image will be at each layout breakpoint. The browser then picks the smallest file that looks sharp on that screen.

Example

next/image generates srcset and sizes from its deviceSizes and imageSizes settings.

Related terms

Taught in

References