Image
Last updated
Last updated
Why use over <img>
?
Images are lazy loaded meaning not loaded if outside viewpoint/unless scrolled to
nextjs will automatically create optimized images in WebP for all device heights and widths, including a jpg fallback for older browsers
Require image ratio to prevent ,
Needs image ratio(width/height) to prevent ,
If imported, Next.js will it
If remote, need to set intrisic width and height not style width and height thats different (or use fill if unknown)
Need to explicitly allow remote image hosts in next.config.js
to safely optimize
Can use fill, but parent element must have position: relative
and display:block
next.config.js