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
- next/image — The Next.js Image component, which resizes, converts and lazy-loads images and reserves their space to prevent layout shift.
- viewport — The visible area of a web page in the browser window or device screen.
- bandwidth — How much data a network connection can carry per second, and by extension the amount of data a request or response uses up.
Taught in
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture